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

            return CreateModel(wrapper);
        }
Ejemplo n.º 2
0
        private void HandleStatusConditionChange(PokemonWrapper target)
        {

            if (target.Condition != calculator.StatusCondition)
            {
                target.Condition = calculator.StatusCondition;
                eventCreator.SetStatus(target, target.Condition);
            }
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 public static MoveModel CreateModel(PokemonWrapper wrapper)
 {
     return new MoveModel(wrapper);
 }
Ejemplo n.º 7
0
 public void SwitchPokemon(PokemonWrapper pokemon)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 8
0
 public void SetStatus(PokemonWrapper pokemon, StatusCondition condition)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 9
0
 public void Effective(MoveEfficiency effect, PokemonWrapper target)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 10
0
 public MoveEffectiveEventArgs(MoveEfficiency effect, PokemonWrapper target)
 {
     Effect = effect;
     Target = target;
 }
Ejemplo n.º 11
0
 private void ExecChange(PokemonWrapper pokemonWrapper, Pokemon newPokemon)
 {
     pokemonWrapper.Pokemon = newPokemon;
     eventCreator.SwitchPokemon(pokemonWrapper);
 }
Ejemplo n.º 12
0
 public void SwitchPokemon(PokemonWrapper pokemon)
 {
     PokemonChanged(this, new ClientPokemonChangedEventArgs(pokemon.Identifier, pokemon));
 }
Ejemplo n.º 13
0
 public void SetPokemon(ClientIdentifier id, PokemonWrapper pokemon)
 {
     PokemonChanged(this, new ClientPokemonChangedEventArgs(id, pokemon));
 }
Ejemplo n.º 14
0
 public void SetStatus(PokemonWrapper pokemon, StatusCondition condition)
 {
     StatusChanged(this, new ClientStatusChangedEventArgs(pokemon.Identifier, condition));
 }
Ejemplo n.º 15
0
 public void Effective(MoveEfficiency effect, PokemonWrapper target)
 {
     MoveEffective(this, new MoveEffectiveEventArgs(effect, target));
 }
Ejemplo n.º 16
0
 public void UsingMove(PokemonWrapper source, Move move)
 {
     MoveUsed(this, new MoveUsedEventArgs(move, source));
 }
Ejemplo n.º 17
0
 private PokemonModel CreateModel(Client client, PokemonWrapper pokemon = null)
 {
     if (pokemon == null)
         pokemon = new PokemonWrapper(client.Id);
     return new PokemonModel(client, pokemon);
 }
Ejemplo n.º 18
0
 private void DoDamage(PokemonWrapper target)
 {
     var damage = calculator.Damage;
     target.HP -= damage;
     eventCreator.SetHP(target.Identifier, target.HP);
 }
Ejemplo n.º 19
0
 public BattleEventFake()
 {
     var pkmn = new Pokemon(new PokemonData { Name = "name" }, new Stats());
     pokemon = new PokemonWrapper(id) { Pokemon = pkmn };
 }
Ejemplo n.º 20
0
 private void HandleEfficiency(PokemonWrapper target)
 {
     var effect = GetEffect(calculator.TypeModifier);
     eventCreator.Effective(effect, target);
 }
Ejemplo n.º 21
0
 public void SetPokemon(ClientIdentifier id, PokemonWrapper pokemon)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 22
0
 public MoveUsedEventArgs(Move move, PokemonWrapper source)
 {
     Move = move;
     Source = source;
 }
Ejemplo n.º 23
0
 public void UsingMove(PokemonWrapper source, Move move)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 24
0
 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;
 }
Ejemplo n.º 26
0
 public SetPokemonEvent(IBattleGraphicController graphic, ClientIdentifier id, PokemonWrapper pokemon)
 {
     this.graphic = graphic;
     this.id = id;
     this.pokemon = pokemon;
 }