public static MoveModel CreateModel(Pokemon pkmn)
        {
            var wrapper = new PokemonWrapper(new ClientIdentifier());
            if(pkmn != null)
                wrapper.Pokemon = pkmn;

            return CreateModel(wrapper);
        }
Exemple #2
0
        private void HandleStatusConditionChange(PokemonWrapper target)
        {

            if (target.Condition != calculator.StatusCondition)
            {
                target.Condition = calculator.StatusCondition;
                eventCreator.SetStatus(target, target.Condition);
            }
        }
Exemple #3
0
 private void ExecMove(PokemonWrapper source, Move move, PokemonWrapper target)
 {
     eventCreator.UsingMove(source, move);
     calculator.Init(source, move, target);
     
     DoDamage(target);
     HandleEfficiency(target);
     CheckIfCritical();
     HandleStatusConditionChange(target);
 }
Exemple #4
0
        internal BattleData(ClientIdentifier player, ClientIdentifier ai)
        {
            Player = player;
            Ai = ai;

            clients.Add(Ai);
            clients.Add(Player);

            PlayerPokemon = new PokemonWrapper(Player);
            AiPokemon = new PokemonWrapper(Ai);
        }
        public void DataChanged_HpOfPokemonChanged_EventIsRaised()
        {
            int numberOfPokemon = 5;
            var client = TestFactory.CreatePlayerClient(numberOfPokemon);
            var pokemonWrapper = new PokemonWrapper(client.Id) { Pokemon = client.Pokemons.First() };
            var pokemonModel = CreateModel(client, pokemonWrapper);
            bool eventWasRaised = false;

            pokemonModel.DataChanged += delegate { eventWasRaised = true; };
            pokemonWrapper.HP = 0;

            Assert.True(eventWasRaised);
        }
 public static MoveModel CreateModel(PokemonWrapper wrapper)
 {
     return new MoveModel(wrapper);
 }
Exemple #7
0
 public void SwitchPokemon(PokemonWrapper pokemon)
 {
     throw new NotImplementedException();
 }
Exemple #8
0
 public void SetStatus(PokemonWrapper pokemon, StatusCondition condition)
 {
     throw new NotImplementedException();
 }
Exemple #9
0
 public void Effective(MoveEfficiency effect, PokemonWrapper target)
 {
     throw new NotImplementedException();
 }
 public MoveEffectiveEventArgs(MoveEfficiency effect, PokemonWrapper target)
 {
     Effect = effect;
     Target = target;
 }
Exemple #11
0
 private void ExecChange(PokemonWrapper pokemonWrapper, Pokemon newPokemon)
 {
     pokemonWrapper.Pokemon = newPokemon;
     eventCreator.SwitchPokemon(pokemonWrapper);
 }
Exemple #12
0
 public void SwitchPokemon(PokemonWrapper pokemon)
 {
     PokemonChanged(this, new ClientPokemonChangedEventArgs(pokemon.Identifier, pokemon));
 }
Exemple #13
0
 public void SetPokemon(ClientIdentifier id, PokemonWrapper pokemon)
 {
     PokemonChanged(this, new ClientPokemonChangedEventArgs(id, pokemon));
 }
Exemple #14
0
 public void SetStatus(PokemonWrapper pokemon, StatusCondition condition)
 {
     StatusChanged(this, new ClientStatusChangedEventArgs(pokemon.Identifier, condition));
 }
Exemple #15
0
 public void Effective(MoveEfficiency effect, PokemonWrapper target)
 {
     MoveEffective(this, new MoveEffectiveEventArgs(effect, target));
 }
Exemple #16
0
 public void UsingMove(PokemonWrapper source, Move move)
 {
     MoveUsed(this, new MoveUsedEventArgs(move, source));
 }
Exemple #17
0
 private PokemonModel CreateModel(Client client, PokemonWrapper pokemon = null)
 {
     if (pokemon == null)
         pokemon = new PokemonWrapper(client.Id);
     return new PokemonModel(client, pokemon);
 }
Exemple #18
0
 private void DoDamage(PokemonWrapper target)
 {
     var damage = calculator.Damage;
     target.HP -= damage;
     eventCreator.SetHP(target.Identifier, target.HP);
 }
Exemple #19
0
 public BattleEventFake()
 {
     var pkmn = new Pokemon(new PokemonData { Name = "name" }, new Stats());
     pokemon = new PokemonWrapper(id) { Pokemon = pkmn };
 }
Exemple #20
0
 private void HandleEfficiency(PokemonWrapper target)
 {
     var effect = GetEffect(calculator.TypeModifier);
     eventCreator.Effective(effect, target);
 }
Exemple #21
0
 public void SetPokemon(ClientIdentifier id, PokemonWrapper pokemon)
 {
     throw new NotImplementedException();
 }
 public MoveUsedEventArgs(Move move, PokemonWrapper source)
 {
     Move = move;
     Source = source;
 }
Exemple #23
0
 public void UsingMove(PokemonWrapper source, Move move)
 {
     throw new NotImplementedException();
 }
 public void SetPokemon(ClientIdentifier id, PokemonWrapper pokemon)
 {
     dataViews[id].SetPokemon(pokemon);
     sprites[id].SetPokemon(pokemon.ID);
 }
 public ClientPokemonChangedEventArgs(ClientIdentifier id, PokemonWrapper pokemon)
 {
     ID = id;
     Pokemon = pokemon;
 }
Exemple #26
0
 public SetPokemonEvent(IBattleGraphicController graphic, ClientIdentifier id, PokemonWrapper pokemon)
 {
     this.graphic = graphic;
     this.id = id;
     this.pokemon = pokemon;
 }