Exemplo n.º 1
0
        public void ToObject(string sentence, PlayerRegister reg)
        {
            string[] stage1 = sentence.Split(';');
            string[] stage11 = stage1[0].Split(',');
            this.from_str = stage11[0];
            this.from = reg.Lookup(stage11[0]);
            this.to = reg.Lookup(stage11[1]);
            this.to_str = stage11[1];
            string[] stage12 = stage1[1].Split(',');

            for (int i = 0; i < stage12.Length; i++)
            {
                this.action.Add(stage12[i].Split(':'));
            }
        }
Exemplo n.º 2
0
 public string getRef(Player p)
 {
     var key = this.dictionary.FirstOrDefault(x => x.Value == p);
     return key.Key;
 }
Exemplo n.º 3
0
 public void Add(string key, Player val)
 {
     this.dictionary.Add(key, val);
 }
Exemplo n.º 4
0
 public void Send(string cardname, Player to)
 {
     to.onpass = take_handcard(cardname);
     this.handcard.Remove(to.onpass);
     this.passcardstatus = true;
 }
Exemplo n.º 5
0
 public bool Pass(Player to, Game g)
 {
     int passed = 0;
     for (int i = 0; i < g.playerName.Length; i++)
     {
         if (g.reg.Lookup(g.playerName[i]).passcardstatus)
             passed++;
     }
     if (passed == g.playerName.Length - 1)
     {
         return false;
     }
     if (this.last == to)
     {
         return false;
     }
     to.onpass = this.onpass;
     this.onpass = null;
     this.passcardstatus = true;
     return true;
 }
Exemplo n.º 6
0
 public void Claim(string cardname, Player to, Game g)
 {
     to.claim = cardname;
     to.last_str = g.reg.getRef(this);
     to.last = this;
 }