Closed dmlary closed 4 years ago
Implement two system approaches: block-based and class-based.
World.register_system(:regen, all: [ HealthComponent, PositionComponent]) do |entity,health,pos| case pos.position when :standing health += 2 end
class System::Regen < System::Base World.register_system(:regen, all: [HealthComponent, PositionComponent], handler: self) def update(entity, health, position) # ... end end
Implement two system approaches: block-based and class-based.
block-basednot implementing this approach; makes it hard to test systemsClass-based