Exemplo n.º 1
0
        /// <summary>
        /// Constructor for new vending machine. Inventory is automatically stocked when creating the machine.
        /// </summary>
        public VendingMachine(IInventorySource inventorySource, ITransactionLogger transactionLogger)
        {
            this.inventorySource   = inventorySource;
            this.transactionLogger = transactionLogger;

            inventory = inventorySource.GetInventory();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Awake is called after all objects are initialized so you can safely speak to other objects. This is where
        /// reference can be associated.
        /// </summary>
        public override void Awake()
        {
            base.Awake();

            // If the input source is still null, see if we can grab a local input source
            if (mInventorySource == null && mMotionController != null)
            {
                mInventorySource = mMotionController.gameObject.GetComponent <IInventorySource>();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Clear this instance.
        /// </summary>
        public override void Clear()
        {
            InventorySource = null;
            ItemID          = null;
            SlotID          = null;
            WeaponSetID     = null;
            Form            = 0;

            base.Clear();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Awake is called after all objects are initialized so you can safely speak to other objects. This is where
        /// reference can be associated.
        /// </summary>
        public override void Awake()
        {
            base.Awake();

            // Object that will provide access to attributes
            if (_InventorySourceOwner != null)
            {
                mInventorySource = InterfaceHelper.GetComponent <IInventorySource>(_InventorySourceOwner);
            }

            // If the input source is still null, see if we can grab a local input source
            if (mInventorySource == null && mMotionController != null)
            {
                mInventorySource = InterfaceHelper.GetComponent <IInventorySource>(mMotionController.gameObject);
                if (mInventorySource != null)
                {
                    _InventorySourceOwner = mMotionController.gameObject;
                }
            }
        }