Skip to content
Snippets Groups Projects
Commit bbb9e0ed authored by phenixceleste's avatar phenixceleste
Browse files

file '7' removed ; setter removed

parent 6a170e65
No related branches found
No related tags found
1 merge request!10Resolve "Implement use of capacities"
Pipeline #9720 passed with stage
in 1 minute and 40 seconds
object PokemonFactory:
private case class Bulbasaur()
extends Pokemon(
"Bulbasaur",
11,
List(Grass, Poison),
List(apply("Absorb"), apply("Vine Whip"), apply("Constrict"), apply("Bubble")),
49,
49,
45,
45,
1
)
private case class Charmander()
extends Pokemon(
"Charmander",
12, List(Fire),
List(apply("Bubble"), apply("Bubble Beam"), apply("Rock Throw"), apply("Absorb")),
52, 43, 65, 39, 1)
private case class Squirtle() extends Pokemon("Squirtle", 11, List(Water), List(), 48, 65, 43, 44, 1)
def apply(name: String): Pokemon = name match
case "Bulbasaur" => Bulbasaur()
case "Charmander" => Charmander()
case "Squirtle" => Squirtle()
......@@ -3,8 +3,5 @@ class Capacity(val name: String, val ctype: Type, val maxUses: Int, private var
// getter
def usesLeft: Int = this._usesLeft
// setter
def usesLeft_=(uses: Int) = this._usesLeft = uses
def use() =
this._usesLeft = this.usesLeft - 1
this._usesLeft = this._usesLeft - 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment