コード例 #1
0
        public RTSClient()
        {
            Display = new RTSDisplay() { Height = 20, Width = 20 };
            Player = new PlayerInfo();
            InGame = false;
            Console.WriteLine("Welcome to Hack CS");

            HostIP = "10.13.110.201";
            string[] randomNames = new string[] { "Pyro", "Heavy", "Spy", "Scout", "Soldier" };
            Player.Name = randomNames[Random.Next(randomNames.Length-1)];
            Player.Symbol = 'O';
            Player.Colour = (ConsoleColor)Enum.GetValues(typeof(ConsoleColor)).GetValue(Random.Next(Enum.GetValues(typeof(ConsoleColor)).Length));

            ThreadPool.QueueUserWorkItem(o => ShowMainMenu());

            while (true)
            { } // Never quit
        }
コード例 #2
0
 public void Load()
 {
     string filename = "options.txt";
     string jsonText = File.ReadAllText(filename);
     Player = (PlayerInfo)JsonConvert.DeserializeObject<PlayerInfo>(jsonText);
 }