Prepare 1.0 alpha3 release.
[tagua/yd.git] / src / agentgroup.h
blob43c2ce5b0cb5d5694c418c1434460bf1e00ace10
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef AGENTGROUP_H
12 #define AGENTGROUP_H
14 #include <boost/shared_ptr.hpp>
15 #include <vector>
16 #include "weakset.h"
17 #include "tagua.h"
18 #include "agent.h"
20 class AgentGroup {
21 typedef boost::shared_ptr<Agent> AgentPtr;
22 typedef std::vector<AgentPtr> AgentList;
24 weak_set<Agent> m_agents;
25 public:
26 void addAgent(const AgentPtr& agent);
28 void clockUpdate(Agent* source, int, int);
29 void move(Agent* source, const Index&);
30 void back(Agent* source);
31 void forward(Agent* source);
32 void gotoFirst(Agent* source);
33 void gotoLast(Agent* source);
36 class AgentGroupDispatcher {
37 AgentGroup* m_group;
38 Agent* m_agent;
39 public:
40 AgentGroupDispatcher(AgentGroup* group, Agent* agent);
41 virtual ~AgentGroupDispatcher(){}
43 virtual void clockUpdate(int, int);
44 virtual bool move(const Index&);
45 virtual bool back();
46 virtual bool forward();
47 virtual bool gotoFirst();
48 virtual bool gotoLast();
51 #endif // AGENTGROUP_H