Mercurial > pyntnclick
annotate gamelib/ss_state.py @ 655:c77d6aa29bee pyntnclick
Some code to kinda demonstrate the ever so cunning state handling plan
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sun, 12 Feb 2012 13:56:59 +0200 |
parents | |
children | 5dc866e1d71d |
rev | line source |
---|---|
655
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
1 """The Custom state object for Suspended Sentence""" |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
2 |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
3 from pyntnclick.state import GameState |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
4 |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
5 class SSState(GameState): |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
6 |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
7 def get_jim_state(self): |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
8 """Check JIM's health""" |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
9 return self['bridge']['ai status'] |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
10 |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
11 def loop_ai(self): |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
12 """Make JIM loopy""" |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
13 self['bridge']['ai status'] = 'looping' |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
14 |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
15 def break_ai(self): |
c77d6aa29bee
Some code to kinda demonstrate the ever so cunning state handling plan
Neil Muller <neil@dip.sun.ac.za>
parents:
diff
changeset
|
16 self['bridge']['ai status'] = 'dead' |