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>(); }
internal OnboardPokemon(Pokemon pokemon, int x) { this.pokemon = pokemon; conditions = new ConditionsDictionary(); Owner = pokemon.Owner; Type1 = pokemon.PokemonType.Type1; Type2 = pokemon.PokemonType.Type2; Gender = pokemon.Gender; Ability = pokemon.Ability; Base = new SixD(pokemon.Base); Iv = new SixD(pokemon.Iv); Ev = new SixD(pokemon.Ev); Static = new SixD(pokemon.Static); Lv5D = new SixD(); Moves = new Move[4] { pokemon.Moves[0], pokemon.Moves[1], pokemon.Moves[2], pokemon.Moves[3] }; Position = new Position(pokemon.TeamId,x); //幻影new完后覆盖属性 Outward = new PokemonOutward(this, pokemon.Hp); Outward.Name = pokemon.Name; Outward.Gender = Gender; Outward.ImageId = pokemon.PokemonType.Id; }
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); }
internal SimPokemon(Pokemon pokemon, PokemonOutward outward) { this.pokemon = pokemon; Outward = outward; //Owner = pokemon.Owner; Position = outward.Position; Moves = new Move[4] { pokemon.Moves[0], pokemon.Moves[1], pokemon.Moves[2], pokemon.Moves[3] }; IsActive = true; foreach (Move m in Moves) if (m != null && m.PP.Value > 0) CanUseMove = true; CanStruggle = !CanUseMove; CanSwitch = true; }
internal BoardOutward(GameSettings settings) { this.settings = settings; teams = new ObservableCollection<PokemonOutward>[settings.TeamCount]; Teams = new ReadOnlyObservableCollection<PokemonOutward>[settings.TeamCount]; pokemons = new List<PokemonOutward>(); weather = Data.Weather.Normal; Terrain = settings.Terrain; var empty = new PokemonOutward[settings.XBound]; for (int i = 0; i < settings.TeamCount; i++) { teams[i] = new ObservableCollection<PokemonOutward>(empty); Teams[i] = new ReadOnlyObservableCollection<PokemonOutward>(teams[i]); } listeners = new List<IBoardEvent>(); }
public void AbilityChanged(PokemonOutward pokemon, Ability from, Ability to) { foreach (IBoardEvent l in listeners) l.AbilityChanged(pokemon, from, to); }
public void ShowAbility(PokemonOutward pokemon, Ability ability) { foreach (IBoardEvent l in listeners) l.ShowAbility(pokemon, ability); }
public void Sendout(PokemonOutward pm) { pokemon = pm; if (pokemon != null) { pokemon.AddListener(this); if (pokemon.Gender == PokemonGender.Female) main.Source = DataService.Image.GetPokemonFemaleFront(pokemon.ImageId); else main.Source = DataService.Image.GetPokemonMaleFront(pokemon.ImageId); } }
void IPokemonEvent.Withdrawn() { pokemon.RemoveListener(this); pokemon = null; }
public SendOut(int playerId, PokemonOutward pokemon) { PlayerId = playerId; Pokemon = pokemon; }
//粉色条 void IBoardEvent.ShowAbility(PokemonOutward pm, Ability ability) { }
//粉色条 void IBoardEvent.AbilityChanged(PokemonOutward pm, Ability from, Ability to) { }