Module: Lich::Gemstone::Creature
- Defined in:
- documented/gemstone/creature.rb
Overview
Main Creature module - provides the public API
This module serves as the primary interface for creature tracking. It delegates to CreatureInstance for runtime tracking and CreatureTemplate for static creature data.
Class Method Summary collapse
-
.[](id) ⇒ Object
Lookup creature instance by ID.
-
.all ⇒ Object
Get all creature instances.
-
.cleanup_old(**options) ⇒ Object
Cleanup old instances.
-
.clear ⇒ Object
Clear all instances.
-
.configure(**options) ⇒ Object
Configure the system.
-
.register(name, id, noun = nil) ⇒ Object
Register a new creature.
-
.stats ⇒ Object
Get registry stats.
Class Method Details
.[](id) ⇒ Object
Lookup creature instance by ID
661 662 663 |
# File 'documented/gemstone/creature.rb', line 661 def self.[](id) CreatureInstance[id] end |
.all ⇒ Object
Get all creature instances
696 697 698 |
# File 'documented/gemstone/creature.rb', line 696 def self.all CreatureInstance.all end |
.cleanup_old(**options) ⇒ Object
Cleanup old instances
691 692 693 |
# File 'documented/gemstone/creature.rb', line 691 def self.cleanup_old(**) CreatureInstance.cleanup_old(**) end |
.clear ⇒ Object
Clear all instances
686 687 688 |
# File 'documented/gemstone/creature.rb', line 686 def self.clear CreatureInstance.clear end |
.configure(**options) ⇒ Object
Configure the system
671 672 673 |
# File 'documented/gemstone/creature.rb', line 671 def self.configure(**) CreatureInstance.configure(**) end |
.register(name, id, noun = nil) ⇒ Object
Register a new creature
666 667 668 |
# File 'documented/gemstone/creature.rb', line 666 def self.register(name, id, noun = nil) CreatureInstance.register(name, id, noun) end |
.stats ⇒ Object
Get registry stats
676 677 678 679 680 681 682 683 |
# File 'documented/gemstone/creature.rb', line 676 def self.stats { instances: CreatureInstance.size, templates: CreatureTemplate.all.size, max_size: CreatureInstance.class_variable_get(:@@max_size), auto_register: CreatureInstance.auto_register? } end |