public VisitorAgent(Vector2 position, float health) : base(position, health) { CurHealth = health; MaxHealth = health; WorldState.Add("hungry", true); WorldState.Add("thirsty", false); WorldState.Add("bladder", false); WorldState.Add("injured", false); WorldState.Add("seeEnemy", false); WorldState.Add("killEnemy", false); WorldState.Add("carryingLitter", false); WorldState.Add("idle", true); WorldState.Add("left", false); Goals.Add(new AIGoalEat(this)); Goals.Add(new AIGoalDrink(this)); Goals.Add(new AIGoalBladder(this)); Goals.Add(new AIGoalDiscardLitter(this)); Goals.Add(new AIGoalIdle(this)); Goals.Add(new AIGoalLeave(this)); Actions.Add(new AIActionEatFood(this)); Actions.Add(new AIActionDrink(this)); Actions.Add(new AIActionBladder(this)); Actions.Add(new AIActionDiscardLitter(this)); Actions.Add(new AIActionRandomWander(this)); Actions.Add(new AIActionLeave(this)); }
private void GenerateObjects(WorldState state, int count) { var x = state.Geography.Width; var y = state.Geography.Height; var rand = new Random(); for (int i = 0; i < count; i++) { var mock = new Mock <WorldObject>(); var location = new Point(rand.Next(x), rand.Next(y)); mock.Setup(m => m.Location).Returns(location); mock.Setup(m => m.Id).Returns(Guid.NewGuid()); state.Add(mock.Object); } }
public JanitorAgent(Vector2 position, float health) : base(position, health) { CurHealth = health; MaxHealth = health; WorldState.Add("seeLitter", true); WorldState.Add("seeFullBin", true); WorldState.Add("idle", true); Goals.Add(new AIGoalPickupLitter(this)); Goals.Add(new AIGoalIdle(this)); Actions.Add(new AIActionPickupLitter(this)); Actions.Add(new AIActionRandomWander(this)); }