lib/gamefic/plot/entities.rb in gamefic-1.5.0 vs lib/gamefic/plot/entities.rb in gamefic-1.5.1

- old
+ new

@@ -8,11 +8,11 @@ # chair = make Entity, name: 'red chair' # chair.name #=> 'red chair' # # @param cls [Class] The Class of the Entity to be created. # @param args [Hash] The entity's properties. - # @return The Entity instance. + # @return [Entity] def make cls, args = {}, &block ent = cls.new args, &block if ent.kind_of?(Entity) == false raise "Invalid entity class" end @@ -53,13 +53,19 @@ raise IndexError.new("Ambiguous entities found from '#{description}'") end result.objects[0] end + # Get an array of entities associated with this plot. + # + # @return [Array<Entity>] def entities p_entities.clone end + # Get an array of players associated with this plot. + # + # @return [Array<Character>] def players p_players.clone end private