Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/cca/annotate/73d577b8cfaa/state.py
Дата изменения: Unknown
Дата индексирования: Fri Feb 28 18:17:11 2014
Кодировка:
cca: state.py annotate

cca

annotate state.py @ 107:73d577b8cfaa

Added tag 1.0 for changeset 1ff4d543476f
author Daniil Alexeyevsky <me.dendik@gmail.com>
date Sat, 18 Dec 2010 19:21:14 +0300
parents 7eeedb501691
children
rev   line source
darkhan@105 1 """Copyright 2010 Aydarkhanov Ruslan, Kurochkin Ilya, Rusinov Ivan
darkhan@105 2
darkhan@105 3 This file is part of Foobar.
darkhan@105 4
darkhan@105 5 Foobar is free software: you can redistribute it and/or modify it under
darkhan@105 6 the terms of the GNU General Public License as published
darkhan@105 7 by the Free Software Foundation, either version 2 of the License,
darkhan@105 8 or (at your option) any later version.
darkhan@105 9
darkhan@105 10 Foobar is distributed in the hope that it will be useful,
darkhan@105 11 but WITHOUT ANY WARRANTY; without even the implied warranty
darkhan@105 12 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
darkhan@105 13 See the GNU General Public License for more details.
darkhan@105 14
darkhan@105 15 You should have received a copy of the GNU General Public License
darkhan@105 16 along with Foobar. If not, see http://www.gnu.org/licenses/.
darkhan@105 17 """
darkhan@105 18
darkhan@105 19
Ilia@0 20 class State(object):
darkhan@11 21
is_rusinov@67 22 def __init__(self, name, symbol, color, key, nums):
darkhan@11 23 self.name = name
darkhan@11 24 self.symbol = symbol
darkhan@11 25 self.color = color
is_rusinov@67 26 self.key = key
darkhan@11 27 self.nums = nums
darkhan@11 28
darkhan@11 29 def next_state(self, num):
Ilia@0 30 return num in self.nums
darkhan@11 31
Ilia@0 32 def __repr__(self):
darkhan@49 33 return self.symbol + " " + self.name