Пример #1
0
        //向指定容器中添加一张固定的牌
        public void AddCardByPlayerItemAndGameContainerType(PlayerItem playerItem, string gameContainerType, CardEntry cardEntry)
        {
            GameContainerItem gameContainerItem = GetGameContainerItemByPlayerItemAndGameContainerType(playerItem, gameContainerType);

            cardEntry.gameContainerType = gameContainerType;
            gameContainerItem.PutOneCard(cardEntry);
        }
Пример #2
0
        //根据玩家和类型创造出容器
        public GameContainerItem CreateContainerByPlayerItemAndGameContainerType(PlayerItem playerItem, string gameContainerType)
        {
            GameContainerItem gameContainerItem = new GameContainerItem();

            gameContainerItem.gameContainerType    = gameContainerType;
            gameContainerItem.controllerPlayerItem = playerItem;
            gameContainerItem.Create();
            return(gameContainerItem);
        }
Пример #3
0
        //向指定容器中添加多张固定的牌
        public void AddCardListByPlayerItemAndGameContainerType(PlayerItem playerItem, string gameContainerType, List <CardEntry> cardEntryList)
        {
            GameContainerItem gameContainerItem = GetGameContainerItemByPlayerItemAndGameContainerType(playerItem, gameContainerType);

            foreach (CardEntry cardEntry in cardEntryList)
            {
                cardEntry.gameContainerType = gameContainerType;
                gameContainerItem.PutOneCard(cardEntry);
            }
        }
Пример #4
0
        //根据玩家和容器类别获取容器
        public GameContainerItem GetGameContainerItemByPlayerItemAndGameContainerType(PlayerItem playerItem, string gameContainerType)
        {
            GameContainerItem returnGameContainerItem = null;

            foreach (GameContainerItem gameContainerItem in gameContainerItemList)
            {
                if (gameContainerItem.controllerPlayerItem == playerItem && gameContainerItem.gameContainerType == gameContainerType)
                {
                    returnGameContainerItem = gameContainerItem;
                }
            }
            return(returnGameContainerItem);
        }
Пример #5
0
        //将一张卡从一个容器移动到另外一个容器
        public bool MoveOneCardFromOldeContainerItemToNeweContainerItem(CardEntry cardEntry, string newGameContainerType)
        {
            UtilityLog.Log("【" + cardEntry.cardInfo.code + "】移动所在位置,从【" + cardEntry.gameContainerType + "】到【" + newGameContainerType + "】", LogUtType.Effect);
            //获取所有者
            PlayerItem playerItem = cardEntry.controllerPlayerItem;
            //获取旧的容器类别
            string oldGameContainerType = cardEntry.gameContainerType;
            //获取旧的容器
            GameContainerItem oldGameContainerItem = GetGameContainerItemByPlayerItemAndGameContainerType(playerItem, oldGameContainerType);

            //旧的容器移除这张卡
            oldGameContainerItem.RemoveOneCardEntry(cardEntry);
            cardEntry.lastGameContainerType = cardEntry.gameContainerType;
            //新的容器添加这张卡
            AddCardByPlayerItemAndGameContainerType(playerItem, newGameContainerType, cardEntry);
            cardEntry.ttCardChangeGameContainerType(cardEntry);
            return(true);
        }