almost there...
[asgard.git] / status.py
blobde5647ad18377ea64fa686e1f1af9bddf4835879
1 ########################################################
2 #Copyright (c) 2006 Russ Adams, Sean Eubanks, Asgard Contributors
3 #This file is part of Asgard.
5 #Asgard 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.
10 #Asgard 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.
15 #You should have received a copy of the GNU General Public License
16 #along with Asgard; if not, write to the Free Software
17 #Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 ########################################################
19 class Status:
20 def __init__(self,n,e,pT,pI,x,pToM):
21 """Constructor."""
22 self.__name = n
23 self.__entrance = e
24 self.__perTurn = pT
25 self.__perIteration = pI
26 self.__exit = x
27 self.__perTurnOnMove = pToM
29 def getName(self):
30 """Get name of status."""
31 return self.__name
33 def setName(self,n):
34 """Set name of status."""
35 self.__name = n
37 def getEntrance(self):
38 """Get entrance transactions."""
39 return self.__entrance
41 def setEntrance(self,e):
42 """Set entrance transactions."""
43 self.__entrance = e
45 def getPerTurn(self):
46 """Get per-turn transactions."""
47 return self.__perTurn
49 def setPerTurn(self,pT):
50 """Set per-turn transactions."""
51 self.__perTurn = pT
53 def getIteration(self):
54 """Get per-iteration transactions."""
55 return self.__perIteration
57 def setIteration(self, pI):
58 """Set per-iteration transactions."""
59 self.__perIteration = pI
61 def getExit(self):
62 """Get exit transactions."""
63 return self.__exit
65 def setExit(self,x):
66 """Set exit transactions."""
67 self.__exit = x
69 def getPerTurnOnMove(self):
70 """Get per-turn on move transactions."""
71 return self.__perTurnOnMove
73 def setPerTurnOnMove(self,pT):
74 """Set per-turn on move transactions."""
75 self.__perTurnOnMove = pT
77 def genEntrance(self):
78 """Generate entrance transactions."""
79 for e in self.__entrance:
80 e.execute()
82 def genPerTurn(self):
83 """Generate per-turn transactions."""
84 for t in self.__perTurn:
85 t.execute()
87 def genIteration(self):
88 """Generate per-iteration transactions."""
89 for i in self.__perIteration:
90 i.execute()
92 def genExit(self):
93 """Generate exit transactions."""
94 for x in self.__exit:
95 x.execute()
97 def genPerTurnOnMove(self):
98 """Generate per-turn transactions."""
99 for t in self.__perTurnOnMove:
100 t.execute()