Пример #1
0
        public void AddActions(InputController <Form1> input)
        {
            input.AddAction(Keys.Right, () => Graphx.DeltaX -= Graphx.CameraSpeed);
            input.AddAction(Keys.Left, () => Graphx.DeltaX  += Graphx.CameraSpeed);
            input.AddAction(Keys.Up, () => Graphx.DeltaY    += Graphx.CameraSpeed);
            input.AddAction(Keys.Down, () => Graphx.DeltaY  -= Graphx.CameraSpeed);

            input.AddAction(Keys.Escape, () => loop.ProcessEsc());
            input.AddAction("build", () => {
                var c = Graphx.CursorToWorldCoords();

                if (world.playerData[world.playerCompanyName].money > 0)
                {
                    world.Build(world.playerCompanyName, Graphx.CursorToWorldCoords(), loop.infraBuilder.Invoke());
                    world.playerData[world.playerCompanyName].money -= loop.infraBuilder.Invoke().price;
                    UpdateMoney();
                }
            });
        }