public int GetUIStateCount(EPlayerUIState state) { if (uiTimer.ContainsKey((int)state)) { return(uiTimer[(int)state].Count); } return(0); }
public void AddUITime(EPlayerUIState state, long serverTime) { if (!uiTimer.ContainsKey((int)state)) { uiTimer.Add((int)state, new List <long>()); } uiTimer[(int)state].Add(serverTime); }
public override void DoAction(IEventArgs args) { EPlayerUIState uiState = (EPlayerUIState)FreeUtil.ReplaceInt(state, args); FreeData p = GetPlayer(args); if (p != null) { if (remove) { PlayerStateUtil.RemoveUIState(uiState, p.Player.gamePlay); } else { int realTime = FreeUtil.ReplaceInt(time, args); if (realTime > 0) { p.StateTimer.AddUITime(uiState, realTime); } PlayerStateUtil.AddUIState(uiState, p.Player.gamePlay); } } }
public static void RemoveUIState(EPlayerUIState state, GamePlayComponent player) { player.UIState &= ~(1 << (int)state); }
public static void AddUIState(EPlayerUIState state, GamePlayComponent player) { player.UIState |= 1 << (int)state; }
public static bool HasUIState(EPlayerUIState state, GamePlayComponent player) { return((player.UIState & (1 << (int)state)) > 0); }