root/trunk/AE-go_GameServer/src/com/aionemu/gameserver/model/gameobjects/player/Player.java
| 980 | 993 | ||
|---|---|---|---|
18 | 18 | ||
19 | import java.util.ArrayList; | 19 | import java.util.ArrayList; |
20 | import java.util.List; | 20 | import java.util.List; |
21 | import java.util.SortedMap; | ||
22 | import java.util.TreeMap; | ||
23 | import java.util.Collections; | ||
21 | 24 | ||
22 | import com.aionemu.commons.callbacks.Enhancable; | 25 | import com.aionemu.commons.callbacks.Enhancable; |
23 | import com.aionemu.gameserver.controllers.PlayerController; | 26 | import com.aionemu.gameserver.controllers.PlayerController; |
... | ... | ||
28 | import com.aionemu.gameserver.model.gameobjects.VisibleObject; | 31 | import com.aionemu.gameserver.model.gameobjects.VisibleObject; |
29 | import com.aionemu.gameserver.model.gameobjects.player.listeners.PlayerLoggedInListener; | 32 | import com.aionemu.gameserver.model.gameobjects.player.listeners.PlayerLoggedInListener; |
30 | import com.aionemu.gameserver.model.gameobjects.player.listeners.PlayerLoggedOutListener; | 33 | import com.aionemu.gameserver.model.gameobjects.player.listeners.PlayerLoggedOutListener; |
34 | import com.aionemu.gameserver.model.gameobjects.Item; | ||
31 | import com.aionemu.gameserver.model.gameobjects.stats.PlayerGameStats; | 35 | import com.aionemu.gameserver.model.gameobjects.stats.PlayerGameStats; |
32 | import com.aionemu.gameserver.model.gameobjects.stats.PlayerLifeStats; | 36 | import com.aionemu.gameserver.model.gameobjects.stats.PlayerLifeStats; |
33 | import com.aionemu.gameserver.model.group.PlayerGroup; | 37 | import com.aionemu.gameserver.model.group.PlayerGroup; |
... | ... | ||
60 | private BlockList blockList; | 64 | private BlockList blockList; |
61 | private ResponseRequester requester; | 65 | private ResponseRequester requester; |
62 | private boolean lookingForGroup = false; | 66 | private boolean lookingForGroup = false; |
63 | private Inventory inventory; | 67 | private Storage inventory; |
68 | private Storage regularWarehouse; | ||
69 | private Storage accountWarehouse; | ||
70 | private SortedMap<Integer, Item> equipment = Collections.synchronizedSortedMap(new TreeMap<Integer, Item>()); | ||
64 | private PlayerStore store; | 71 | private PlayerStore store; |
65 | private PlayerStatsTemplate playerStatsTemplate; | 72 | private PlayerStatsTemplate playerStatsTemplate; |
66 | private TitleList titleList; | 73 | private TitleList titleList; |
... | ... | ||
305 | /** | 312 | /** |
306 | * @return the inventory | 313 | * @return the inventory |
307 | */ | 314 | */ |
308 | public Inventory getInventory() | 315 | |
316 | public SortedMap<Integer, Item> getEquipment() | ||
309 | { | 317 | { |
310 | return inventory; | 318 | return equipment; |
311 | } | 319 | } |
312 | 320 | ||
313 | /** | 321 | /** |
... | ... | ||
373 | QuestEnv env = new QuestEnv(obj, this, questId, 0); | 381 | QuestEnv env = new QuestEnv(obj, this, questId, 0); |
374 | if (QuestEngine.getInstance().getQuest(env).checkStartCondition()) | 382 | if (QuestEngine.getInstance().getQuest(env).checkStartCondition()) |
375 | { | 383 | { |
376 | if (!nearbyQuestList.contains(questId)) | 384 | if (!nearbyQuestList.contains(questId)) |
377 | { | 385 | { |
378 | nearbyQuestList.add(questId); | 386 | nearbyQuestList.add(questId); |
379 | } | 387 | } |
380 | } | 388 | } |
381 | } | 389 | } |
382 | } | 390 | } |
... | ... | ||
393 | * @param inventory | 401 | * @param inventory |
394 | * the inventory to set Inventory should be set right after player object is created | 402 | * the inventory to set Inventory should be set right after player object is created |
395 | */ | 403 | */ |
396 | public void setInventory(Inventory inventory) | 404 | public void setStorage(Storage storage, StorageType storageType) |
397 | { | 405 | { |
398 | this.inventory = inventory; | 406 | if(storageType == StorageType.CUBE) |
399 | inventory.setOwner(this); | 407 | { |
400 | } | 408 | this.inventory = storage; |
409 | inventory.setOwner(this); | ||
410 | } | ||
401 | 411 | ||
402 | /** | 412 | if(storageType == StorageType.REGULAR_WAREHOUSE) |
403 | * @param CubeUpgrade | 413 | { |
404 | * int Sets the cubesize | 414 | this.regularWarehouse = storage; |
405 | */ | 415 | regularWarehouse.setOwner(this); |
406 | public void setCubesize(int cubesize) | 416 | } |
407 | { | ||
408 | this.playerCommonData.setCubesize(cubesize); | ||
409 | } | ||
410 | 417 | ||
411 | /** | 418 | if(storageType == StorageType.ACCOUNT_WAREHOUSE) |
412 | * @return the playerSettings | 419 | { |
413 | */ | 420 | this.accountWarehouse = storage; |
414 | public PlayerSettings getPlayerSettings() | 421 | accountWarehouse.setOwner(this); |
415 | { | 422 | } |
416 | return playerSettings; | ||
417 | } | ||
418 | 423 | ||
419 | /** | ||
420 | * @param playerSettings the playerSettings to set | ||
421 | */ | ||
422 | public void setPlayerSettings(PlayerSettings playerSettings) | ||
423 | { | ||
424 | this.playerSettings = playerSettings; | ||
425 | } | 424 | } |
426 | 425 | ||
427 | /** | 426 | public Storage getStorage(int storageType) |
428 | * @return the zoneInstance | ||
429 | */ | ||
430 | public ZoneInstance getZoneInstance() | ||
431 | { | 427 | { |
432 | return zoneInstance; | 428 | if(storageType == StorageType.REGULAR_WAREHOUSE.getId()) |
433 | } | 429 | return regularWarehouse; |
434 | 430 | ||
435 | /** | 431 | if(storageType == StorageType.ACCOUNT_WAREHOUSE.getId()) |
436 | * @param zoneInstance the zoneInstance to set | 432 | return accountWarehouse; |
437 | */ | ||
438 | public void setZoneInstance(ZoneInstance zoneInstance) | ||
439 | { | ||
440 | this.zoneInstance = zoneInstance; | ||
441 | } | ||
442 | 433 | ||
443 | public TitleList getTitleList() | 434 | if(storageType == StorageType.CUBE.getId()) |
444 | { | 435 | return inventory; |
445 | return titleList; | 436 | else |
437 | return null; | ||
446 | } | 438 | } |
447 | | ||
448 | public void setTitleList(TitleList titleList) | ||
449 | { | ||
450 | this.titleList = titleList; | ||
451 | titleList.setOwner(this); | ||
452 | } | ||
453 | 439 | ||
454 | /** | 440 | public Storage getInventory() |
455 | * @return the playerGroup | ||
456 | */ | ||
457 | public PlayerGroup getPlayerGroup() | ||
458 | { | 441 | { |
459 | return playerGroup; | 442 | return inventory; |
460 | } | 443 | } |
461 | 444 | ||
462 | /** | 445 | /** |
463 | * @param playerGroup the playerGroup to set | 446 | * @param CubeUpgrade |
447 | * int Sets the cubesize | ||
464 | */ | 448 | */ |
465 | public void setPlayerGroup(PlayerGroup playerGroup) | 449 | public void setCubesize(int cubesize) |
466 | { | 450 | { |
467 | this.playerGroup = playerGroup; | 451 | this.playerCommonData.setCubesize(cubesize); |
468 | } | 452 | } |
469 | 453 | ||
470 | @Override | 454 | /** |
471 | public void initializeAi() | 455 | * @return the playerSettings |
472 | { | 456 | */ |
473 | // TODO Auto-generated method stub | 457 | public PlayerSettings getPlayerSettings() |
474 | } | 458 | { |
459 | return playerSettings; | ||
460 | } | ||
475 | 461 | ||
476 | /** | 462 | /** |
477 | * This method is called when player logs into the game. It's main responsibility is to call all registered | 463 | * @param playerSettings the playerSettings to set |
478 | * listeners.<br> | 464 | */ |
479 | * <br> | 465 | public void setPlayerSettings(PlayerSettings playerSettings) |
480 | * | 466 | { |
481 | * <b><font color='red'>NOTICE: </font>this method is supposed to be called only from | 467 | this.playerSettings = playerSettings; |
482 | * {@link PlayerService#playerLoggedIn(Player)}</b> | 468 | } |
483 | */ | ||
484 | @Enhancable(callback = PlayerLoggedInListener.class) | ||
485 | public void onLoggedIn() | ||
486 | { | ||
487 | 469 | ||
488 | } | 470 | /** |
471 | * @return the zoneInstance | ||
472 | */ | ||
473 | public ZoneInstance getZoneInstance() | ||
474 | { | ||
475 | return zoneInstance; | ||
476 | } | ||
489 | 477 | ||
490 | /** | 478 | /** |
491 | * This method is called when player leaves the game. It's main responsibility is to call all registered listeners.<br> | 479 | * @param zoneInstance the zoneInstance to set |
492 | * <br> | 480 | */ |
493 | * | 481 | public void setZoneInstance(ZoneInstance zoneInstance) |
494 | * <b><font color='red'>NOTICE: </font>this method is supposed to be called only from | 482 | { |
495 | * {@link PlayerService#playerLoggedOut(Player)}</b> | 483 | this.zoneInstance = zoneInstance; |
496 | */ | 484 | } |
497 | @Enhancable(callback = PlayerLoggedOutListener.class) | ||
498 | public void onLoggedOut() | ||
499 | { | ||
500 | 485 | ||
501 | } | 486 | public TitleList getTitleList() |
487 | { | ||
488 | return titleList; | ||
489 | } | ||
490 | |||
491 | public void setTitleList(TitleList titleList) | ||
492 | { | ||
493 | this.titleList = titleList; | ||
494 | titleList.setOwner(this); | ||
495 | } | ||
496 | |||
497 | /** | ||
498 | * @return the playerGroup | ||
499 | */ | ||
500 | public PlayerGroup getPlayerGroup() | ||
501 | { | ||
502 | return playerGroup; | ||
503 | } | ||
504 | |||
505 | /** | ||
506 | * @param playerGroup the playerGroup to set | ||
507 | */ | ||
508 | public void setPlayerGroup(PlayerGroup playerGroup) | ||
509 | { | ||
510 | this.playerGroup = playerGroup; | ||
511 | } | ||
512 | |||
513 | @Override | ||
514 | public void initializeAi() | ||
515 | { | ||
516 | // TODO Auto-generated method stub | ||
517 | } | ||
518 | |||
519 | /** | ||
520 | * This method is called when player logs into the game. It's main responsibility is to call all registered | ||
521 | * listeners.<br> | ||
522 | * <br> | ||
523 | * | ||
524 | * <b><font color='red'>NOTICE: </font>this method is supposed to be called only from | ||
525 | * {@link PlayerService#playerLoggedIn(Player)}</b> | ||
526 | */ | ||
527 | @Enhancable(callback = PlayerLoggedInListener.class) | ||
528 | public void onLoggedIn() | ||
529 | { | ||
530 | |||
531 | } | ||
532 | |||
533 | /** | ||
534 | * This method is called when player leaves the game. It's main responsibility is to call all registered listeners.<br> | ||
535 | * <br> | ||
536 | * | ||
537 | * <b><font color='red'>NOTICE: </font>this method is supposed to be called only from | ||
538 | * {@link PlayerService#playerLoggedOut(Player)}</b> | ||
539 | */ | ||
540 | @Enhancable(callback = PlayerLoggedOutListener.class) | ||
541 | public void onLoggedOut() | ||
542 | { | ||
543 | |||
544 | } | ||
502 | } | 545 | } |
Download diff