예제 #1
0
    //void Function for Fight
    public void Fight(bool b, List <Unit> uList, FSMac <i_STATES> FSM)
    {
        char input;
        //Player list
        Player listp = new Player();
        //Enemy list
        Enemy liste = new Enemy();
        Unit  a     = new Unit();

        for (int i = 0; i < uList.Count; i++)
        {
            if (uList.ElementAt(i).Type == "Player")
            {
                Console.Write("Press 1 to Attack");
                input = (char)Console.Read();

                if (input == '1')
                {
                    if (uList.ElementAt(i).Combat(a.Indicator(liste.EP)) == true)
                    {
                        break;
                    }
                }
            }
            else if (uList.ElementAt(i).Type == "Enemy")
            {
            }
        }
    }
예제 #2
0
        static void Main(string[] args)
        {
            FSMac<i_STATES> FSM = new FSMac<i_STATES>();
            //Adding States
            FSM.AddState(i_STATES.Init);
            FSM.AddState(i_STATES.Idle);
            FSM.AddState(i_STATES.Target);
            FSM.AddState(i_STATES.Death);

            //Adding Transitions
            FSM.AddT(i_STATES.Init, i_STATES.Idle);
            FSM.AddT(i_STATES.Idle, i_STATES.Target);
            FSM.AddT(i_STATES.Target, i_STATES.Death);

            //Graps a list of units
            List<Unit> uList = new List<Unit>();

            FSM.info();
            Console.ReadLine();
        }
예제 #3
0
        static void Main(string[] args)
        {
            FSMac <i_STATES> FSM = new FSMac <i_STATES>();

            //Adding States
            FSM.AddState(i_STATES.Init);
            FSM.AddState(i_STATES.Idle);
            FSM.AddState(i_STATES.Target);
            FSM.AddState(i_STATES.Death);

            //Adding Transitions
            FSM.AddT(i_STATES.Init, i_STATES.Idle);
            FSM.AddT(i_STATES.Idle, i_STATES.Target);
            FSM.AddT(i_STATES.Target, i_STATES.Death);

            //Graps a list of units
            List <Unit> uList = new List <Unit>();



            FSM.info();
            Console.ReadLine();
        }