Example #1
0
        public Dolphin DolphinGameRun(int sequenceLineIndex)
        {
            Console.WriteLine("Game {0} from line {0} of sequences. Nb Dophins uniquely have speed.", sequenceLineIndex);
            Console.WriteLine("Each single move is multiplied by the speed factor.");
            _dolphin = (Dolphin)SeaAnimalGameInit(_dolphin);
            //Run Through Sequences
            foreach (var sequence in _theSequences.SequenceList[sequenceLineIndex])
            {
                DolphinAction(sequence);
                Console.WriteLine("Next move,direction and Dolphins current position {0},{1},{2},{3}", sequence, _dolphin.direction, _dolphin.x_position, _dolphin.y_position);
                _dolphin = (Dolphin)EvaluateSeaAnimalActions((SeaAnimal)_dolphin);

                if (_dolphin.AnimalHasWon == true || _dolphin.AnimalHasLost)
                {
                    break;
                }
            }

            //Evaluate if still in danger after all sequences.
            EvaluateStillInDanger();
            FinalEvalutationReport();

            return(_dolphin);
        }
Example #2
0
 public DolphinGameActions(Dolphin dolphin, GameSettings gs, Sequences sq)
 {
     _initialGameSettings = gs;
     _theSequences        = sq;
     _dolphin             = dolphin;
 }