public bool Find(Player p) { if (players.Contains(p)) return true; return false; }
private static bool IsThisPlayerCaptain(Player p) { if (m_PlayerMerges.ContainsKey(p.id)) return true; return false; }
public void Add(Player p) { players.Add(p); }
public static Vector2 GetAvgDirectionForAllPlayers(Player pCaptain) { Vector2 result = new Vector2(); foreach (Player p in Player.m_PlayerMerges[pCaptain.id].players) { float moveX = GamePad.GetState(p.id).ThumbSticks.Left.X; float moveY = -GamePad.GetState(p.id).ThumbSticks.Left.Y; Vector2 playerDir = new Vector2(moveX, moveY); if (playerDir.Length() > 0) { playerDir.Normalize(); result += playerDir; } } // Get captain movement float fCaptainMoveX = GamePad.GetState(pCaptain.id).ThumbSticks.Left.X; float fCaptainMoveY = GamePad.GetState(pCaptain.id).ThumbSticks.Left.Y; result += new Vector2(fCaptainMoveX, -fCaptainMoveY); if (result.Length() > 0) result.Normalize(); return result; }