Created
September 2, 2016 11:12
-
-
Save DarkDesire/3686cc5f84d56f53c71636d32dda3d58 to your computer and use it in GitHub Desktop.
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
import StatType.StatType | |
object NewMain extends App{ | |
val one = new Person("sss") | |
val two = new Person("sas") with IHaveStats | |
two.requirements = Set(new Force(40),new Wind(40)) | |
two.requirements.foreach(obj => println(s"${obj.name} + ${obj.modifierType} + ${obj.value}")) | |
} | |
class Person(name:String) | |
trait IHaveStats{ | |
var requirements = Set[Stat]() | |
var effect = Set[Stat]() | |
} | |
trait IHaveWeight{ | |
var weight = 0 | |
} | |
class Buff(name:String, modifiers: Set[Stat], duration:Int) | |
object TargetType extends Enumeration { | |
type TargetType = Value | |
val Any, Enemy, Friendly = Value | |
} | |
class Stat(val name: String,val modifierType: StatType,val value:Int) | |
object StatType extends Enumeration { | |
type StatType = Value | |
val Force, Dexterity, Endurance, Accuracy = Value | |
val Fire, Water, Wind, Earth = Value | |
val PhysicalAttack, PhysicalDefense = Value | |
val MagicalAttack, MagicalDefense = Value | |
val Dignity, Degree = Value | |
val Health, Prana, Karma = Value | |
val LevelOfItem, Lifetime, Validity, Quantity, Durability, Tradability = Value | |
val Specialization, LevelOfSpecialization = Value | |
val Cooldown, StartCharges, MaxCharges, Distance, Description = Value | |
val Speed, JumpHeight = Value | |
} | |
class Force(value:Int) extends Stat("Force",StatType.Force,value) | |
class Dexterity(value:Int) extends Stat("Dexterity",StatType.Dexterity,value) | |
class Endurance(value:Int) extends Stat("Endurance",StatType.Endurance,value) | |
class Accuracy(value:Int) extends Stat("Accuracy",StatType.Accuracy,value) | |
class Fire(value:Int) extends Stat("Fire",StatType.Fire,value) | |
class Wind(value:Int) extends Stat("Wind",StatType.Wind,value) | |
class Water(value:Int) extends Stat("Water",StatType.Water,value) | |
class Earth(value:Int) extends Stat("Earth",StatType.Earth,value) | |
class PhysicalAttack(value:Int) extends Stat("Physical Attack",StatType.PhysicalAttack,value) | |
class PhysicalDefense(value:Int) extends Stat("Physical Defense",StatType.PhysicalDefense,value) | |
class MagicalAttack(value:Int) extends Stat("Magical Attack",StatType.MagicalAttack,value) | |
class MagicalDefense(value:Int) extends Stat("Magical Defense",StatType.MagicalDefense,value) | |
class Dignity(value:Int) extends Stat("Dignity",StatType.Dignity,value) | |
class Degree(value:Int) extends Stat("Degree",StatType.Degree,value) | |
class Health(value:Int) extends Stat("Health",StatType.Health,value) | |
class Prana(value:Int) extends Stat("Prana",StatType.Prana,value) | |
class Karma(value:Int) extends Stat("Karma",StatType.Karma,value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment