예제 #1
0
 public UserMessage(int clientId)
     : base(clientId)
 {
     type = Packet.USERMESSAGE;
     time = DateTime.Now;
     position = new Vector2f (0, 0);
     input = new Input();
     ticktime = 0;
 }
예제 #2
0
        public InputManager(Client client)
        {
            this.client = client;
            RenderWindow window = client.MainWindow;
            input = new Input();

            keyMap = new Dictionary<Keyboard.Key, Action<bool>>();

            keyMap[Keyboard.Key.Up] = moveUp;
            keyMap[Keyboard.Key.Down] = moveDown;
            keyMap[Keyboard.Key.Left] = moveLeft;
            keyMap[Keyboard.Key.Right] = moveRight;
            keyMap[Keyboard.Key.R] = resetPlayer;
            keyMap[Keyboard.Key.PageUp] = zoomIn;
            keyMap[Keyboard.Key.PageDown] = zoomOut;
            keyMap[Keyboard.Key.A] = layerIn;
            keyMap[Keyboard.Key.Z] = layerOut;
            keyMap[Keyboard.Key.N] = toggleNoclip;
            keyMap[Keyboard.Key.Escape] = toMainMenu;
        }