//======================================================================================================= private void HandleVkey(GameVkey vkey, float arg) { if (OnVkey == null) { return; } OnVkey(vkey, arg); }
private bool HandleReleasePlayerVkey(GameVkey vkey, float arg, uint playerId) { if (vkey == GameVkey.ReleasePlayer) { ReleasePlayer(playerId); return(true); } return(false); }
//============================================================================================================== private bool HandleCreatePlayerVkey(GameVkey vkey, float arg, uint playerId) { /* * if (vkey == GameVkey.CreatePlayer) * { * CreatePlayer(playerId); * return true; * } */ return(false); }
//============================================================================================================== public void InputVkey(GameVkey vkey, float arg, uint playerId) { if (playerId == 0) { HandleOtherVkey(vkey, arg, playerId); return; } FlyingPlayer player = GetPlayer(playerId); if (player != null) { player.InputVkey(vkey, arg); } else { HandleOtherVkey(vkey, arg, playerId); } }
private bool HandleVkey(GameVkey vkey, float arg) { switch (vkey) { case GameVkey.MoveHorizontal: m_flyingVehicle.RoteLR(arg); break; case GameVkey.MoveVertical: m_flyingVehicle.RoteUD(arg); break; case GameVkey.SpeedUp: m_flyingVehicle.MoveFB(arg); break; default: return(false); } return(true); }
private void OnVkey(GameVkey vkey, float arg) { GameLogicManager.Instance.InputVkey(vkey, arg, m_mainPlayerId); }
public bool HandleOtherVkey(GameVkey vkey, float arg, uint playerId) { return(HandleCreatePlayerVkey(vkey, arg, playerId) || HandleReleasePlayerVkey(vkey, arg, playerId)); }
public void InputVkey(GameVkey vkey, float arg) { bool isHandled = false; isHandled = isHandled || HandleVkey(vkey, arg); }