Пример #1
0
            public bool Find(Player p)
            {
                if (players.Contains(p))
                    return true;

                return false;
            }
Пример #2
0
        private static bool IsThisPlayerCaptain(Player p)
        {
            if (m_PlayerMerges.ContainsKey(p.id))
                return true;

            return false;
        }
Пример #3
0
 public void Add(Player p)
 {
     players.Add(p);
 }
Пример #4
0
        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;
        }