Saturday, February 20, 2010

Attribute tag personality

With my Gnome Mountain mini-project (using this to build up all the 2D parts of the game engine) I've decided to develop an attribute tag based personality system. This will be used for the Gnome AI.

The personality class:

An example of the use, checking if a gnome is a miner and finding him a job:
if (gnome.personality.hasAttribute(PersonalityAttribute.Miner))
{
if (findMiningActionForGnome(gnome, world))
return;
}

The system basically works using a Dictionary< Attribute, Skill Level > collection.

No comments:

Post a Comment