示例#1
0
        public Boolean HasEaten()
        {
            Theseus theseus = myGame.GetTheseus();

            if (Coordinate == theseus.Coordinate)
            {
                return(true);
            }
            return(false);
        }
示例#2
0
        protected void SetCharacters(int theMap)
        {
            switch (theMap)
            {
            case 1:
                minotaur = SetMinotaur(1, 0);
                theseus  = SetTheseus(1, 2);
                break;

            case 2:
                theseus  = SetTheseus(2, 1);
                minotaur = SetMinotaur(0, 1);
                break;

            case 3:
                theseus  = SetTheseus(1, 1);
                minotaur = SetMinotaur(1, 0);
                break;

            case 4:
                theseus  = SetTheseus(1, 1);
                minotaur = SetMinotaur(4, 2);
                break;

            case 5:
                theseus  = SetTheseus(2, 1);
                minotaur = SetMinotaur(2, 4);
                break;

            case 6:
                theseus  = SetTheseus(0, 1);
                minotaur = SetMinotaur(4, 3);
                break;

            case 7:
                theseus  = SetTheseus(4, 5);
                minotaur = SetMinotaur(0, 5);
                break;

            case 9:
                theseus  = SetTheseus(1, 1);
                minotaur = SetMinotaur(3, 2);
                break;

            default:
                break;
            }
        }
示例#3
0
        public void Hunt()
        {
            Theseus theseus = myGame.GetTheseus();

            for (int i = 0; i < 2; i++)
            {
                Console.WriteLine("M turn " + (i + 1));
                // if minotaur's X value isn't the same as theseus'
                if (Coordinate.X != theseus.Coordinate.X)
                {
                    HuntHorizontal();
                }
                else if (Coordinate.X == theseus.Coordinate.X)
                {
                    HuntVertical();
                }
            }
        }
示例#4
0
        protected void HuntVertical()
        {
            Theseus theseus = myGame.GetTheseus();

            if (Coordinate.Y > theseus.Coordinate.Y)
            {
                if (!Move(Direction.Up))
                {
                    Console.WriteLine("blocked");
                }
            }
            if (Coordinate.Y < theseus.Coordinate.Y)
            {
                if (!Move(Direction.Down))
                {
                    Console.WriteLine("blocked");
                }
            }
        }
示例#5
0
        protected void HuntHorizontal()
        {
            Theseus theseus = myGame.GetTheseus();

            // if Theseus is to the left
            if (Coordinate.X > theseus.Coordinate.X)
            {
                if (!Move(Direction.Left))
                {
                    HuntVertical();
                }
            }
            if (Coordinate.X < theseus.Coordinate.X)
            {
                if (!Move(Direction.Right))
                {
                    HuntVertical();
                }
            }
        }
示例#6
0
文件: Filer.cs 项目: midas06/Theseus
 public void SetTestCharacters(int testMap)
 {
     switch (testMap)
     {
         case 1:
             theseus = SetTheseus(1, 1);
             minotaur = SetMinotaur(3, 1);
             break;
         case 2:
             theseus = SetTheseus(3, 0);
             minotaur = SetMinotaur(0, 0);
             break;
         case 3:
             theseus = SetTheseus(3, 0);
             minotaur = SetMinotaur(0, 0);
             break;
         default:
             break;
     }
 }
示例#7
0
        public void SetTestCharacters(int testMap)
        {
            switch (testMap)
            {
            case 1:
                theseus  = SetTheseus(1, 1);
                minotaur = SetMinotaur(3, 1);
                break;

            case 2:
                theseus  = SetTheseus(3, 0);
                minotaur = SetMinotaur(0, 0);
                break;

            case 3:
                theseus  = SetTheseus(3, 0);
                minotaur = SetMinotaur(0, 0);
                break;

            default:
                break;
            }
        }
示例#8
0
 protected Theseus SetTheseus(int newX, int newY)
 {
     theseus = new Theseus(newX, newY);
     return(theseus);
 }
示例#9
0
文件: Game.cs 项目: midas06/Theseus
 public void SetTheseus(Theseus newTheseus)
 {
     theseus = newTheseus;
     theseus.SetGame(this);
 }
示例#10
0
文件: Filer.cs 项目: midas06/Theseus
 protected Theseus SetTheseus(int newX, int newY)
 {
     theseus = new Theseus(newX, newY);
     return theseus;
 }
示例#11
0
文件: Filer.cs 项目: midas06/Theseus
        protected void SetCharacters(int theMap)
        {
            switch (theMap)
            {
                case 1:
                    minotaur = SetMinotaur(1, 0);
                    theseus = SetTheseus(1, 2);
                    break;
                case 2:
                    theseus = SetTheseus(2, 1);
                    minotaur = SetMinotaur(0, 1);
                    break;
                case 3:
                    theseus = SetTheseus(1, 1);
                    minotaur = SetMinotaur(1, 0);
                    break;
                case 4:
                    theseus = SetTheseus(1, 1);
                    minotaur = SetMinotaur(4, 2);
                    break;
                case 5:
                    theseus = SetTheseus(2, 1);
                    minotaur = SetMinotaur(2, 4);
                    break;
                case 6:
                    theseus = SetTheseus(0, 1);
                    minotaur = SetMinotaur(4, 3);
                    break;
                case 7:
                    theseus = SetTheseus(4, 5);
                    minotaur = SetMinotaur(0, 5);
                    break;

                case 9:
                    theseus = SetTheseus(1, 1);
                    minotaur = SetMinotaur(3, 2);
                    break;
                default:
                    break;
            }
        }
示例#12
0
 public void SetTheseus(Theseus newTheseus)
 {
     theseus = newTheseus;
     theseus.SetGame(this);
 }