Пример #1
0
        NetworkItemContainer CreateContainer(List <NetworkItem> contents, float posX, float posY, float posZ, ushort type)
        {
            NetworkItemContainer newContainer = new NetworkItemContainer(posX, posY, posZ, type);

            foreach (NetworkItem item in contents)
            {
                newContainer.AddItem(item);
            }

            return(newContainer);
        }
Пример #2
0
        void TransferItemBetweenContainers(NetworkItem item, NetworkItemContainer fromContainer, NetworkItemContainer toContainer)
        {
            // Does from container have enough item?
            if (fromContainer.CheckHasItem(item))
            {
                // Then remove item from donor container
                fromContainer.DeleteItem(item);

                // And add to receiver container
                toContainer.AddItem(item);
            }
        }
Пример #3
0
        public Player(ushort id, float x, float y)
        {
            ID = id;
            X  = x;
            Y  = y;

            rotX = 0f;
            rotY = 0f;
            rotZ = 0f;
            rotW = 0f;

            inventory = new NetworkItemContainer(0, 0, 0, 1);
            inventory.AddItem(new NetworkItem("item.resource.gold", 10));
            inventory.AddItem(new NetworkItem("item.resource.wood", 5));
        }