Beispiel #1
0
 public Player(string id, string name, int age, Tactic tactic)
 {
     this.id     = id;
     this.name   = name;
     this.age    = age;
     this.tactic = tactic;
 }
Beispiel #2
0
        private List <Tactic> readTactics()
        {
            List <Tactic> tactics = new List <Tactic>();

            foreach (string line in File.ReadLines(TACTICS_FILE))
            {
                Tactic tactic = new Tactic();
                if (line == null)
                {
                    continue;
                }

                //szétdaraboljuk a sort két részre
                string[] str = Utils.splitString(line, '|', 2);
                tactic.playerId = str[0]; //playerId

                if (str[1] == null)
                {
                    continue;
                }
                string[] szazalekok = Utils.splitString(str[1], '-', 3);
                tactic.rock     = double.Parse(szazalekok[0]);
                tactic.paper    = double.Parse(szazalekok[1]);
                tactic.scissors = double.Parse(szazalekok[2]);

                tactics.Add(tactic);
            }


            return(tactics);
        }