private static void AddToDictionary(string unparsedWrestlerString)
        {
            string key = UsefulActions.GetDataFromUnparsedFile(unparsedWrestlerString, "Name: ");

            WrestlerData wrestlerData = new WrestlerData(unparsedWrestlerString);

            if (allWrestlers.ContainsKey(key))
            {
                throw new Exception("The wrestler '" + key + "' already exists.");
            }
            allWrestlers.Add(key, wrestlerData);
        }
예제 #2
0
 public Wrestler(WrestlerData myData)
 {
     this.myData     = myData;
     health          = MAX_HEALTH_POINTS;
     maxHealth       = MAX_HEALTH_POINTS;
     headHealth      = MAX_HEALTH_POINTS;
     torsoHealth     = MAX_HEALTH_POINTS;
     armHealth       = MAX_HEALTH_POINTS;
     legHealth       = MAX_HEALTH_POINTS;
     stamina         = MAX_STAMINA;
     momentum        = 100;
     actionTimer     = 0;
     stunnedTimer    = 0;
     collapseCounter = 0;
     currentPosition = WrestlerPosition.STANDING;
 }
예제 #3
0
        public static void Main(string[] args)
        {
            UsefulActions.InitialiseRandom();
            MoveDictionary.Initialise();
            WrestlerDictionary.Initialise();

            Console.WriteLine("Welcome to my Wrestling Simulator!");
            Console.WriteLine("Currently you can only do pin-fall only matches which require at least 2 wrestlers (can do multi-man matches).");
            Console.WriteLine("\nHere's the list of all available wrestlers:");
            WrestlerDictionary.ListAllWrestlers();
            Console.WriteLine("\nList all wrestlers you wish to add into the match, then type START when you're done.");

            List <Wrestler> wrestlersInMatch = new List <Wrestler> ();
            string          userInput        = "";

            while (!userInput.Equals("START"))
            {
                userInput = Console.ReadLine();
                WrestlerData wrestlerDetails = WrestlerDictionary.GetWrestler(userInput);
                if (wrestlerDetails == null)
                {
                    Console.WriteLine("The wrestler: '{0}' does not exist.", userInput);
                    continue;
                }
                Wrestler wrestler = new Wrestler(wrestlerDetails);
                wrestlersInMatch.Add(wrestler);

                Console.WriteLine("{0} has been added.", userInput);
            }

            /*Wrestler wrestlerA = new Wrestler (WrestlerDictionary.GetWrestler ("Bob Dylan"));
             * Wrestler wrestlerB = new Wrestler (WrestlerDictionary.GetWrestler ("Jake Matthews"));
             * Wrestler wrestlerC = new Wrestler (WrestlerDictionary.GetWrestler ("Michael Lopez"));
             * Wrestler[] wrestlerList = new Wrestler[] { wrestlerA, wrestlerB, wrestlerC };*/

            Match.instance = new NormalMatch(wrestlersInMatch.ToArray());
            Match.instance.ProcessMatch();

            Console.WriteLine("The program will end after you press enter.");
            Console.ReadLine();
        }