Funkční komunikace mezi jedním clientem a serverem

This commit is contained in:
Perry 2025-12-19 17:54:50 +01:00
commit 3f235f6e04
44 changed files with 1030 additions and 0 deletions

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;
using MonoGameLibrary.Input;
using PacketLib;
namespace FNAF_Clone;
public class CommandManager {
private static (string label, Keys key, Action action)[] keybinds = [
("Toggle Camera", Keys.S, ToggleCamera)
];
private static InputListenerHook toggleCamHook = new(true);
public static void InitInputListeners() {
Array.ForEach(keybinds, tuple => InputManager.AddListener(tuple.label, tuple.key, _ => tuple.action(), InputTiming.PRESS, toggleCamHook));
}
private static void ToggleCamera() {
Client.SendCommands([PlayerCommand.TOGGLE_MONITOR()]);
}
}