Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gg.zue.entity.prototyper.EntityDefinition
- /**
- * Created by Michael Zuegg on 10.07.2016.
- */
- class BaseConfig extends EntityDefinition {
- @Override
- void onLoad() {
- Type("Base") {
- Components(
- Component(PositionComponent.class) {
- //No Default Parameters
- }
- )
- }
- Type("Damageable") {
- Components(
- Component(LifeComponent.class) {
- health=100; //Default Parameters
- maxHealth=100;
- }
- )
- }
- /**
- * Has now Postion and Life with the default parameters
- */
- Type("Human"){
- Extends("Base","Damageable")
- }
- Type("Mike"){
- Extends("Human")
- }
- /**
- * Same as Mike, but with increased maxHealth
- */
- Type("Peter"){
- Extends("Human")
- Components(
- Component(LifeComponent.class){
- maxHealth=200; //Does now have health=100 and maxHealth=200;
- }
- )
- }
- //Same as every humand, but with removed LifeComponent
- Type("God"){
- Extends("Humand")
- RemoveComponents(LifeComponent.class)
- }
- /**
- * Removes the PositionComponent form this entity AND
- * all entities extending from it so even God would
- * be left without position (Could be usefull for supporting mods)
- */
- UpdateType("BaseUnit") {
- RemoveComponents(PositionComponent.class)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment