31 lines
732 B
Ruby
31 lines
732 B
Ruby
# Module for vrobot4 bot interfaces.
|
|
module Vrobot4::Robots
|
|
# Generic bot interface.
|
|
class Bot
|
|
# @param info [Hash] arbitrary extra information for this bot
|
|
def initialize info
|
|
@info = info
|
|
end
|
|
end
|
|
|
|
# Adds a bot type to the global list.
|
|
# @param type [Class] bot type to add
|
|
# @return [void]
|
|
def self.add_bot_type type
|
|
@@bot_types[type.type] = type
|
|
Vrobot4.log :INFO, "added bot type: #{type.type}"
|
|
end
|
|
|
|
# Gets a bot type by name from the global list.
|
|
# @param name [String] name of the bot type to find
|
|
# @return [Class] the bot type
|
|
def self.get_bot_type name
|
|
@@bot_types[name]
|
|
end
|
|
|
|
# The set of all bot types.
|
|
@@bot_types = {}
|
|
end
|
|
|
|
## EOF
|