cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages
Class MyInventoryCompositeImpl

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MyInventory
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MyInventoryCompositeImpl
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ICompositeWorldObject, Event

public class MyInventoryCompositeImpl
extends MyInventory

Composite implementation of the MYINV abstract message. It wraps Local/Shared/Static parts in single object allowing to presenting a nice facade for users.

Complete message documentation: An object in the observed player's inventory.


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MyInventory
MyInventory.MyInventoryUpdate
 
Field Summary
protected  MyInventoryLocalImpl partLocal
           
protected  MyInventoryStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MyInventory
PROTOTYPE, SimTime
 
Constructor Summary
MyInventoryCompositeImpl()
          Parameter-less contructor for the message.
MyInventoryCompositeImpl(MyInventoryCompositeImpl original)
          Cloning constructor.
MyInventoryCompositeImpl(MyInventoryLocalImpl partLocal, MyInventorySharedImpl partShared, MyInventoryStaticImpl partStatic)
          Composite-impl constructor.
 
Method Summary
 int getAmount()
          If this item is ammo or armor, this holds the amount of the item the player has.
 int getCurrentAltAmmo()
          If this item is a weapon, this holds the amount of secondary ammo.
 int getCurrentAmmo()
          If this item is a weapon, this holds the amount of primary ammo.
 ItemDescriptor getDescriptor()
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
 UnrealId getId()
          Unique Id of the item.
 MyInventoryLocal getLocal()
           
 MyInventoryShared getShared()
           
 MyInventoryStatic getStatic()
           
 ItemType getType()
          Class of the item (e.g.
 void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.MyInventory
getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected MyInventoryStaticImpl partStatic

partLocal

protected MyInventoryLocalImpl partLocal
Constructor Detail

MyInventoryCompositeImpl

public MyInventoryCompositeImpl()
Parameter-less contructor for the message.


MyInventoryCompositeImpl

public MyInventoryCompositeImpl(MyInventoryLocalImpl partLocal,
                                MyInventorySharedImpl partShared,
                                MyInventoryStaticImpl partStatic)
Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.

Parameters:
partLocal - local-part of the message
partShared - shared-part of the message
partStatic - static-part of the message

MyInventoryCompositeImpl

public MyInventoryCompositeImpl(MyInventoryCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

public void setSimTime(long SimTime)
Description copied from class: MyInventory
Used by Yylex to slip correct time of the object or programmatically.

Overrides:
setSimTime in class MyInventory

getStatic

public MyInventoryStatic getStatic()

getLocal

public MyInventoryLocal getLocal()

getShared

public MyInventoryShared getShared()

getId

public UnrealId getId()
Description copied from class: MyInventory
Unique Id of the item. This Id represents the item in the inventory.

Specified by:
getId in interface IWorldObject
Specified by:
getId in class MyInventory
Returns:

getCurrentAmmo

public int getCurrentAmmo()
Description copied from class: MyInventory
If this item is a weapon, this holds the amount of primary ammo.

Specified by:
getCurrentAmmo in class MyInventory

getCurrentAltAmmo

public int getCurrentAltAmmo()
Description copied from class: MyInventory
If this item is a weapon, this holds the amount of secondary ammo.

Specified by:
getCurrentAltAmmo in class MyInventory

getAmount

public int getAmount()
Description copied from class: MyInventory
If this item is ammo or armor, this holds the amount of the item the player has.

Specified by:
getAmount in class MyInventory

getType

public ItemType getType()
Description copied from class: MyInventory
Class of the item (e.g. xWeapons.FlakCannonPickup).

Specified by:
getType in class MyInventory

getDescriptor

public ItemDescriptor getDescriptor()
Description copied from class: MyInventory
Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.

Specified by:
getDescriptor in class MyInventory

toString

public java.lang.String toString()
Overrides:
toString in class MyInventory

toHtmlString

public java.lang.String toHtmlString()
Overrides:
toHtmlString in class MyInventory