예제 #1
0
 private static void PlaceOptional(World world)
 {
     PlacePiece(world, 1, 1, Position.Orientation.Down);
     PlacePiece(world, 7, 1, Position.Orientation.Down);
     PlacePiece(world, 1, 7, Position.Orientation.Up);
     PlacePiece(world, 7, 7, Position.Orientation.Up);
 }
예제 #2
0
 private static void PlaceHorizonal(World world, int line, Position.Orientation orient)
 {
     for (int i = 0; i < ShogiEnvironment.Board_X; i++)
     {
         PlacePiece(world, i, line, orient);
     }
 }
예제 #3
0
        public static void Init(World world)
        {
            for (int i = 0; i < ShogiEnvironment.Board_X; i++)
                for (int j = 0; j < ShogiEnvironment.Board_Y; j++)
                    PlacePiece(world, i, j, Position.Orientation.None);

            PlaceHorizonal(world, 0, Position.Orientation.Down);
            PlaceHorizonal(world, 2, Position.Orientation.Down);
            PlaceHorizonal(world, 6, Position.Orientation.Up);
            PlaceHorizonal(world, 8, Position.Orientation.Up);
            PlaceOptional(world);
        }
예제 #4
0
        public Scene_Play()
        {
            world = new World();
            klistener = new KeyListener();

            world.InitBoard();
            world.InitBoard(); //1回だけだと例外が発生する
            BoardInitializer.Init(world);

            Pointing = delegate(int x, int y) { world.OnFocus(x, y); };
            Clicking = delegate(int Code) { world.OnClick(Code); };

            klistener.OnPoint += Pointing;
            klistener.MouseDown += Clicking;

            IsRunning = true;
            klistener.KeyDown += delegate(int KeyCode) { if(KeyCode == DX.KEY_INPUT_ESCAPE) IsRunning = false; };
        }
예제 #5
0
 private static void PlacePiece(World world, int x, int y, Position.Orientation orient)
 {
     world.PlacePiece(x, y, orient);
 }