示例#1
0
 public static TurnArgsType GetTurnArgs(NakiType naki)
 {
     if (!(initialized))
     {
         Initialize();
     }
     return(nakiTurnArgs[naki]);
 }
示例#2
0
        //Checks the naki list to see if it contains a type
        private bool ContainsType(NakiType type)
        {
            int i = 0;

            while (i < calls.Count && calls[i].type != type)
            {
                i++;
            }
            if (i == calls.Count)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
示例#3
0
        public int owner;//0-self 1-left 2-front 3-right

        public Naki(List <Card> cardList, Card income, int o)
        {
            this.cards    = new Card[4];
            this.cards[0] = income;
            this.cards[1] = cardList[0];
            this.cards[2] = cardList[1];
            this.owner    = o;
            if (cardList.Count == 3)
            {
                this.cards[3] = cardList[2];
                this.type     = owner == 0 ? NakiType.AnKang : NakiType.Kang;
            }
            else
            {
                this.type = cards[0].cindex == cards[1].cindex ? NakiType.Peng : NakiType.Chi;
            }
        }
示例#4
0
        //Gets the first naki of the type in the meld list
        //...[that involves the given TileID, if that arg is passed]
        private Naki GetNaki(NakiType type, TileID involving = null)
        {
            int i = 0;

            while (i < calls.Count && calls[i].type != type)
            {
                i++;
            }
            if (i == calls.Count)
            {
                return new Naki()
                       {
                           type = NakiType.Nashi                           /*, requestor = player*/
                       }
            }
            ;
            else
            {
                return(calls[i]);
            }
        }
示例#5
0
        public void ReadXml(XmlLoad X)
        {
            int Count = X.GetIntAttribute("count");

            Type = (NakiType)X.GetIntAttribute("value");
            FromWho = X.GetIntAttribute("from");

            Tiles = new List<int>();

            XmlLoad Subtree = X.GetSubtree();
            for (int i = 0; i < Count; i++)
            {
                if (!Subtree.Read()) break;
                switch (Subtree.ElementName)
                {
                    case "tile":
                        Tiles.Add(Subtree.GetIntAttribute("value"));
                        break;
                }
            }
            Subtree.Close();
        }