Beispiel #1
0
        //Adds stats of the new Entity to the Lists
        public void AddEntity(int[] stats, string[] traits)
        {
            ID.Add(next_ID);
            Alive.Add(next_ID);


            Str.Add(stats[0]);
            Agi.Add(stats[1]);
            Int.Add(stats[2]);

            //Behaviour.Add(traits);
            Behaviour.Add(traits);

            ////selects the corresponding Behaviour
            switch (traits[1])
            {
            case "Friendly": Friendlies.Add(next_ID); break;

            case "Hostile": Hostiles.Add(next_ID); break;

            case "Neutral": Neutrals.Add(next_ID); break;

            default: Console.WriteLine("Error, assuming Neutral"); Neutrals.Add(next_ID); break;
            }

            switch (traits[2])
            {
            case "Melee": AttackDamage.Add(stats[0] + stats[1]); break;

            case "Ranged": AttackDamage.Add(stats[1] + stats[2]); break;
            }

            next_ID++;
        }