TypeEffectivenessKit is a Type Effectiveness Checker for all kinds of Pokémon Types and Pokémon Move Types. With TypeEffectivenessKit, you'll be able to have a simple yet flexible framework to work with.
Just import TypeEffectivenessKit:
import TypeEffectivenessKit
Then, you can use it as you please. Like this quick example using single types:
let pokemonType: PokemonType = .fire
let moveType: PokemonType = .water
let effectiveness = pokemonType.checkSingleTypeEffectiveness(offensiveType: moveType)
print(effectiveness.localized) // Super Effective
An example using a Pokémon that has two types. This is one option:
let pokemonFirstType: PokemonType = .fire
let pokemonSecondType: PokemonType = .ghost
let moveType: PokemonType = .grass
let effectiveness = pokemonFirstType.checkDualTypeEffectiveness(otherType: pokemonSecondType, offensiveType: moveType)
print(effectiveness.localized) // Not Very Effective
Another example using Dual Type Pokémon, now using a struct named DualType that includes it with a convenience method:
let pokemonFirstType: PokemonType = .fairy
let pokemonSecondType: PokemonType = .psychic
let dualType = DualType(firstType: pokemonFirstType, secondType: pokemonSecondType)
let moveType: PokemonType = .dragon
let effectiveness = dualType.fetchTypeEffectivenessAccordingTo(moveType)
print(effectiveness.localized) // No Effect
This package also includes several SwiftUI views that display the types, color and symbols in a stylish way. As well as grids and stacks. You can use these views as you please. Explore 'em all!
TypeEffectivenessKit also comes with several scenes that you can learn from for how to use types. Such as this one and many others:
All examples are located on the View folder, but the elements should be able to be used just with the package import.
You can also add this library using Swift Package Manager.
iOS 15+
macOS 12+
watchOS 7+
tvOS 14+
This package is just for hobby and educational purposes. It may not be used for commercial releases. Pokémon is a trademark of Nintendo, Game Freak, The Pokémon Company and Creatures Inc. No copyright or trademark infringement is intended.
link |
Stars: 2 |
Last commit: 1 year ago |
This version includes all functionality for the Kit, while also including some example projects located on the View folder. Have fun!
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics