Esempio n. 1
0
File: Turn.cs Progetto: sunoru/PBO
        private readonly PokemonOutward[] pokemons; //onBoardOnly

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 为了节约流量,只在用户第一次进入房间的时候给出teams/pms/weather信息
        /// </summary>
        internal Turn(TeamOutward[] teams, PokemonOutward[] pms, Weather weather)
        {
            Teams = teams;
              pokemons = pms;
              Weather = weather;
              Events = new List<GameEvent>();
        }
Esempio n. 2
0
 public void ContinueTurn()
 {
     TeamOutward[] t = new TeamOutward[game.Teams.Length];
       for (int i = 0; i < t.Length; i++) t[i] = game.Teams[i].GetOutward();
       PokemonOutward[] p = new PokemonOutward[game.Board.Pokemons.Count];
       for (int i = 0; i < p.Length; i++) p[i] = game.Board.Pokemons[i].GetOutward();
       lastTurn = turn;
       turn = new Turn(t, p, game.Board.Weather);
 }
Esempio n. 3
0
 public GameOutward(GameSettings settings)
 {
     Settings = settings;
       Board = new BoardOutward(Settings);
       Teams = new TeamOutward[Settings.TeamCount];
       for (int t = 0; t < Settings.TeamCount; t++)
     Teams[t] = new TeamOutward(6, 0, 0);
       listeners = new List<IGameEventListener>();
 }
Esempio n. 4
0
 internal void Update(TeamOutward team)
 {
     if (Normal != team.Normal || Abnormal != team.Abnormal || Dying != team.Dying)
       {
     Normal = team.Normal;
     Abnormal = team.Abnormal;
     Dying = team.Dying;
     //很少有只变一个数字的,干脆null
     if (PropertyChanged != null)
       PropertyChanged(this, new PropertyChangedEventArgs(null));
       }
 }
Esempio n. 5
0
 internal Singles(Room.IUserController c)
 {
     controller = c.PlayerController;
       controller.AddEventsListener(this);
       board = c.Game.Board;
       teamPms = c.Game.Teams[controller.Player.TeamId];
       rivalPms = c.Game.Teams[1 - controller.Player.TeamId];
       selectedPanel = (int)ControlPanelIndex.INACTIVE;
       //controller.Board.MyTeam.PokemonOnBoardChanged += (sender, e) =>
       //  {
       //    if (e.NewPokemon != null) pokemonsInBall.Remove(e.NewPokemon);
       //    if (e.OldPokemon != null) pokemonsInBall.Add(e.OldPokemon);
       //  };
       //pokemonsInBall = new List<IPokemon>(controller.Player.Pokemons.Where(p => p.PositionOnBoard == null));//如果中途加载的话有可能存在正在战斗的精灵
       //this.controller_IsActiveChanged(null, null);
 }