Moved global.* to mastersettings.*, and converted many error messages to use the...
[tagua/yd.git] / src / agentgroup.h
blobad1d951a870d4d9c97f230741fec320fd94611f9
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
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 "kboard.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, AbstractMove::Ptr, AbstractPosition::Ptr);
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(AbstractMove::Ptr, AbstractPosition::Ptr);
45 virtual bool back();
46 virtual bool forward();
47 virtual bool gotoFirst();
48 virtual bool gotoLast();
51 #endif // AGENTGROUP_H