Exemple #1
0
        public void SpawnItem(string itemType, ICanHoldItem holder)
        {
            Item toAdd = ItemFactory.Instance.GetNewItem(itemType);

            toAdd.Holder    = holder;
            toAdd.ItemState = holder.PickupItem(toAdd);
        }
Exemple #2
0
 /// <summary>
 /// Initialises a new instance of the Item class.
 /// </summary>
 /// <param name="weight">The weight.</param>
 /// <param name="texture">The texture.</param>
 /// <param name="itemType">The type.</param>
 /// <param name="owner">The owning game world.</param>
 public Item(float weight, string texture, string itemType, GameWorld owner) : base(owner)
 {
     _itemType               = itemType;
     _texture                = texture;
     _isReserved             = false;
     _isMemberOfSpatialIndex = false;
     _itemState              = ItemStates.Nowhere;
     _holder      = null;
     _weight      = weight;
     _position    = new Point(-1, -1);
     _storageSize = 1;
 }
Exemple #3
0
 public static void OnItemCreate(ICanHoldItem target, Item item)
 {
     item.ItemState = target.PickupItem(item);
     item.Holder    = target;
 }
Exemple #4
0
 public static void PlaceItem(ICanHoldItem source, ICanHoldItem target, Item item)
 {
     source.PutdownItem(item);
     item.Holder    = target;
     item.ItemState = target.PickupItem(item);
 }
Exemple #5
0
 public ActorStatePlaceItem(Actor myActor, ICanHoldItem newItemHolder, GameWorld owner)
     : base(myActor, owner, true)
 {
     NewItemHolder = newItemHolder;
     ActionType    = "pickupitem";
 }