ポケモンの性格の列挙型
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stat { | |
let attack補正: Float | |
let deffence補正: Float | |
init(attack: Float, deffence: Float) { | |
self.attack補正 = attack | |
self.deffence補正 = deffence | |
} | |
} | |
enum 性格 { | |
static let おっとり = Stat(attack: 0.9, deffence: 1.1) | |
static let がんばりや = Stat(attack: 1.0, deffence: 1.0) | |
} | |
print("\(性格.おっとり.attack補正) \(性格.おっとり.deffence補正)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment