Пример #1
0
        public void Run()
        {
            string input = null;

            while (input != "drop")
            {
                input = consoleRead.Read();

                string[] command = input.Split();

                switch (command[0])
                {
                case "create":
                    string name     = command[1];
                    int    health   = Int32.Parse(command[2]);
                    int    damage   = Int32.Parse(command[3]);
                    string behavior = command[4];
                    string attack   = command[5];

                    blob = blobCreator.Create(name, health, damage, behavior, attack);
                    data.AddBlob(blob);
                    break;

                case "attack":
                    string attacker = command[1];
                    string defender = command[2];
                    data.Blobs = attackBlob.Attack(data.Blobs, attacker, defender);
                    break;

                case "status":
                    consoleWrite.WriteList(data.Blobs);
                    break;

                case "pass":
                    break;

                default:
                    break;
                }
            }
        }