Documentation Update. Part 2.
[asgard.git] / status.py
blobb5e63d1e79ea5820316b3b6c629d991751da3729
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:
21 __name = ""
22 """ The name of the status. (i.e. "poison") """
24 __entrance = []
25 """ List of Transaction's to execute on entry into this Status. (i.e. hp -5%) """
27 __perTurn = []
28 """ List of Transaction's to execute each turn of the afflicted Fighter. """
30 __perIteration = []
31 """ List of Transaction's to execute each game loop iteration. """
33 __exit = []
34 """ List of Transaction's to execute on the exit of a Status. """
36 __perTurnOnMove = []
37 """ """
39 def __init__(self,n,e,pT,pI,x,pToM):
40 """Simple Constructor."""
41 self.__name = n
42 self.__entrance = e
43 self.__perTurn = pT
44 self.__perIteration = pI
45 self.__exit = x
46 self.__perTurnOnMove = pToM
48 def getName(self):
49 """Get name of status."""
50 return self.__name
52 def setName(self,n):
53 """Set name of status."""
54 self.__name = n
56 def getEntrance(self):
57 """Get entrance transactions."""
58 return self.__entrance
60 def setEntrance(self,e):
61 """Set entrance transactions."""
62 self.__entrance = e
64 def getPerTurn(self):
65 """Get per-turn transactions."""
66 return self.__perTurn
68 def setPerTurn(self,pT):
69 """Set per-turn transactions."""
70 self.__perTurn = pT
72 def getIteration(self):
73 """Get per-iteration transactions."""
74 return self.__perIteration
76 def setIteration(self, pI):
77 """Set per-iteration transactions."""
78 self.__perIteration = pI
80 def getExit(self):
81 """Get exit transactions."""
82 return self.__exit
84 def setExit(self,x):
85 """Set exit transactions."""
86 self.__exit = x
88 def getPerTurnOnMove(self):
89 """Get per-turn on move transactions."""
90 return self.__perTurnOnMove
92 def setPerTurnOnMove(self,pT):
93 """Set per-turn on move transactions."""
94 self.__perTurnOnMove = pT
96 def genEntrance(self):
97 """Generate entrance transactions."""
98 for e in self.__entrance:
99 e.execute()
101 def genPerTurn(self):
102 """Generate per-turn transactions."""
103 for t in self.__perTurn:
104 t.execute()
106 def genIteration(self):
107 """Generate per-iteration transactions."""
108 for i in self.__perIteration:
109 i.execute()
111 def genExit(self):
112 """Generate exit transactions."""
113 for x in self.__exit:
114 x.execute()
116 def genPerTurnOnMove(self):
117 """Generate per-turn when a fighter moves transactions."""
118 for t in self.__perTurnOnMove:
119 t.execute()