Before we will register our first listener, we have to understand
Pogamut's abstraction of the world where the bot lives. Bot's view of
the world is provided through the IWorldView
interface. This interface serves as both bot's senses and a simple
memory. The abstraction used by IWorldView
the
world is represented by:
Objects (IWorldObject
) – eg. players,
items etc.
Events (IWorldEvent
) – eg. bot heard a
noise, bot bumped to a wall etc. Events are divided into two
categories:
Object events (IWorldObjectEvent
) –
there are five events of this type:
First encountered
(WorldObjectFirstEncounteredEvent
) –
raised when the bot encounters some object (eg.
Player
) for the first time.
Appeared
(WorldObjectAppearedEvent
) – object
entered bot's field of view.
Updated
(WorldObjectUpdatedEvent
) – object's
state was updated.
Disappeared
(WorldObjectDisappearedEvent
) –
object disappeared from bot's field of view.
Destroyed
(WorldObjectDestroyedEvent
) – object
was destroyed (e.g., the player has been disconnected from the
game).
Events not associated with any object (plain
IWorldEvent
) – example of such event can
be HearNoise
that is raised when the bot
hears some noise or BotBumped
that is sent
whenever the bot bumps into something (or someone bumps to the bot).
IWorldView
interface together with
IAct
represent the basic API for accessing the
world, hence you should get familiar with them.