Exemple #1
0
 private float m_wf = 0;  //风力
 public override void SetMap(Map map)
 {
     base.SetMap(map);
     UpdateAGW();
 }
Exemple #2
0
        public BaseGame(List<GamePlayer> red, List<GamePlayer> blue, Map map,eRoomType roomType,eTeamType teamType, eGameType gameType, int timeType)
        {
            m_players = new Dictionary<GamePlayer, Player>();
            m_redTeam = new List<Player>();
            m_blueTeam = new List<Player>();
            m_roomType = roomType;
            m_gameType = gameType;
            m_teamType = teamType;
            m_random = new Random();

            m_redAvgLevel = 0;
            foreach (GamePlayer player in red)
            {
                Player fp = new Player(player, this, 1);
                fp.Direction = m_random.Next(0, 1) == 0 ? 1 : -1;
                m_players.Add(player, fp);
                m_redTeam.Add(fp);
                player.CurrentGame = this;
                m_redAvgLevel += player.PlayerCharacter.Grade;

                fp.Died += new PlayerEventHandle(Player_Died);
            }
            m_redAvgLevel = m_redAvgLevel / m_redTeam.Count;

            m_blueAvgLevel = 0;
            foreach (GamePlayer player in blue)
            {
                Player fp = new Player(player, this, 2);
                fp.Direction = m_random.Next(0, 1) == 0 ? 1 : -1;
                m_players.Add(player, fp);
                m_blueTeam.Add(fp);
                player.CurrentGame = this;
                m_blueAvgLevel += player.PlayerCharacter.Grade;

                fp.Died += new PlayerEventHandle(Player_Died);
            }
            m_blueAvgLevel = m_blueAvgLevel / blue.Count;

            m_map = map;
            m_actions = new ArrayList();
            PhysicalId = 0;

            switch (m_roomType)
            {
                case eRoomType.Freedom:
                    m_mapType = eMapType.Normal;
                    break;
                case eRoomType.Match:
                    m_mapType = eMapType.PairUp;
                    break;
                default:
                    m_mapType = eMapType.Normal;
                    break;
            }
            
           
            m_timeType = timeType;
            m_tempBox = new List<Box>();
            m_tempPoints = new List<Point>();
            Cards = new int[8];
            GameState = eGameState.Inited;
        }
Exemple #3
0
 public virtual void SetMap(Map map)
 {
     m_map = map;
 }
Exemple #4
0
 public override void setMap(Map map)
 {
     base.setMap(map);
     if (_map != null)
     {
         _arf = _map.airResistance * _airResitFactor;
         _gf = _map.gravity * _gravityFactor * _mass;
         _wf = _map.wind * _windFactor;
         //Console.WriteLine(string.Format("_arf {0}  _gf {1}  _wf {2}", _arf, _gf, _wf));
     }
 }