source: trunk/PARPG/scripts/agents/agent.py @ 62

Revision 62, 1.4 KB checked in by maximinus_parpg, 11 years ago (diff)

Large restructure of PC and NPC classes.
Data seperation is a lot cleaner.
Again some old Rio code removed.

Line 
1#!/usr/bin/python
2
3#   This file is part of PARPG.
4
5#   PARPG 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 3 of the License, or
8#   (at your option) any later version.
9
10#   PARPG is distributed in the hope that it will be useful,
11#   but WITHOUT ANY WARRANTY; without even the implied warranty of
12#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#   GNU General Public License for more details.
14
15#   You should have received a copy of the GNU General Public License
16#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>.
17
18import fife
19
20class Agent(fife.InstanceActionListener):
21    """Base class for all NPC's and the main character"""
22    # self.model,'PC',self.agent_layer
23    def __init__(self,agentName,layer):
24        # add this class for callbacks from fife itself
25        fife.InstanceActionListener.__init__(self)
26        self.agentName=agentName
27        self.agent=layer.getInstance(agentName)
28        self.agent.addActionListener(self)
29
30    def onInstanceActionFinished(self, instance, action):
31        """Called when an action is finished - normally overridden"""
32        raise CodeError("No OnActionFinished defined for Agent")
33
34    def start(self):
35        """Called when agent first used - normally overridden"""
36        raise CodeError("No start defined for Agent")
37
Note: See TracBrowser for help on using the repository browser.