示例#1
0
        public void Init()
        {
            byte[] ram = new byte[0x4000];

            displayBoard = DisplayBoard.getInstance(new WpcCpuBoard.InitObject
            {
                interruptCallback = new InterruptCallbackData(),
                ram = ram
            });
        }
示例#2
0
        public void InitializeItems()
        {
            theaterOneTime = new TimeSpan(15, 30, 0);
            theaterTwoTime = new TimeSpan(20, 45, 0);

            theaterOne = new Theater("Orchid", theaterOneTime);
            theaterTwo = new Theater("Rose", theaterTwoTime);

            movieOne = new Movie("Avengers Endgame", 3, "Superheroes in action", "Chris Hemsworth");
            movieTwo = new Movie("Birdbox", 1, "Don't make a sound", "Sandra Bullock");

            theaterOne.Movie = movieOne;
            theaterTwo.Movie = movieTwo;

            displayBoardOne = new DisplayBoard();
            displayBoardOne.AddTheaters(theaterOne);
            displayBoardOne.AddTheaters(theaterTwo);
            displayBoardOne.AddMovies(movieOne);
            displayBoardOne.AddMovies(movieTwo);
        }
示例#3
0
        static void Main(string[] args)
        {
            var Menu = true;

            //Setting The Game

            //Main Menu
            while (Menu)
            {
                int choice;

                var consoleKey = MainMenu.GetConsoleKey();

                if (consoleKey.Key == ConsoleKey.Escape)
                {
                    break;
                }

                else if (int.TryParse(consoleKey.KeyChar.ToString(), out choice) == false || consoleKey.Key == ConsoleKey.H)
                {
                    continue;
                }

                Console.Clear();

                //Setting the Board
                var board = SettingGame.GetBoard(choice);


                //Declaring Which Main Class (Action Handler Class : IPawnActionHandler(Implemetation)) I Want To Execute With Gameplay Class!!!
                var GamePlay = new GamePlay(new PawnActionHandler());

                var GameOn = true;

                //Plyer Request = User Input and Current Board
                var playerRequest = new PlayerRequest();

                //The Game Started
                while (GameOn)
                {
                    //Printing The Board
                    DisplayBoard.Display(board);


                    //The Player Enters Input
                    var playerinput = GameInput.GetPlayerInput(board);

                    if (playerinput.Equals(false))
                    {
                        Thread.Sleep(2000);
                        Console.Clear();
                        break;
                    }


                    //If The Player Couldn't Play Because The Input Wasn't Good To Play a Turn (Move or Eat a Pawn) it will equals to true
                    var anotherTurn = true;

                    playerRequest.MovementInput = (Input)playerinput;
                    playerRequest.Board         = board;


                    //The player Try to Move
                    if (GameActions.Move(playerRequest, board, GamePlay) == true)
                    {
                        anotherTurn = false;
                    }


                    //The Player Try to Eat
                    else
                    {
                        Console.WriteLine("\nUnssucceful Move...\n");
                        Thread.Sleep(2000);

                        if (GameActions.Eat(playerRequest, board, GamePlay) == true)
                        {
                            anotherTurn = false;
                        }

                        else
                        {
                            Console.WriteLine("\nUnsuccessful First Eat Move...\n");
                            Thread.Sleep(2000);
                        }
                    }


                    //The Player Didn't Success To Move or to Eat
                    if (anotherTurn == true)
                    {
                        continue;
                    }


                    //Check If The Pawns Neeeds To Change (Type)
                    ChangeTypes.ChangeTheTypes(board);


                    //Exit?? If Someone lost all of his pawns
                    if (Exit.ExitCheck() == true)
                    {
                        GameOn = false;
                        continue;
                    }

                    //Current Color Turn

                    board.CurrentTurn = Colors.ChangeTheColor(board.CurrentTurn);

                    //Save Game???
                    //if (SettingGame.SaveGame(board) == true)
                    //    GameOn = false;

                    //Console.WriteLine($"\nBlack Pawns = {SettingGame.BlackPawnsAlive.Count}\nWhite Pawns = {SettingGame.WhitePawnsAlive.Count}\n");
                }
            }
        }
示例#4
0
 public MainWindow()
 {
     InitializeComponent();
     displayBoard = new DisplayBoard(this);
     EraseDisplay = true;
 }
示例#5
0
 public override void Right()
 {
     //  Debug.LogWarning("right");
     DisplayBoard.ShowDisplayBoard(this, gameObject.transform.position, explain);
 }
 public Floors(int l)
 {
     parkingspot = new List <ParkingSpot>();
     db          = new DisplayBoard();
     floor_no    = l;
 }