Example #1
0
 public bool ProcessSubgoals(Gpremacy.State state)
 {
     foreach (Goal thisSubGoal in Subgoals)
     {
     thisSubGoal.HandleState(state);
     }
     return true;
 }
Example #2
0
        public override bool HandleState(Gpremacy.State state)
        {
            if (state is Orig_Play2Sell)
            {
            System.Console.WriteLine("Can sell.");
            return true;
            }
            if (state is Orig_Play6Prospect)
            {
            System.Console.WriteLine("Can buy.");
            return true;
            }

            return false;
        }
Example #3
0
        public override bool HandleState(Gpremacy.State state)
        {
            if (state is Orig_Play4Move)
            {
            System.Console.WriteLine("Can expand.");
            acquireInactiveResources();
            return true;
            }
            if (state is Orig_Play6Prospect)
            {
            System.Console.WriteLine("Can prospect.");
            doProspectForResources();
            return true;
            }

            return false;
        }
Example #4
0
        public override bool HandleCommand(Gpremacy.Command cmd)
        {
            bool handled = false;

            /* Ask each of our subgoals in sequence to try
             * and handle this command. If they fail, then we
             * give it a shot. */
            foreach (Goal g in Subgoals)
            {
            if (g.HandleCommand(cmd))
                handled = true;
            }

            /* See if we can handle this ourselves.. */

            /* Done */
            return handled;
        }
Example #5
0
        public override bool HandleState(Gpremacy.State state)
        {
            bool SubgoalStatus = ProcessSubgoals(state);

            return SubgoalStatus;
        }