Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/cca/raw-annotate/1ff4d543476f/state.py
Дата изменения: Unknown
Дата индексирования: Fri Feb 11 13:25:08 2011
Кодировка:

darkhan@105: """Copyright 2010 Aydarkhanov Ruslan, Kurochkin Ilya, Rusinov Ivan
darkhan@105:
darkhan@105: This file is part of Foobar.
darkhan@105:
darkhan@105: Foobar is free software: you can redistribute it and/or modify it under
darkhan@105: the terms of the GNU General Public License as published
darkhan@105: by the Free Software Foundation, either version 2 of the License,
darkhan@105: or (at your option) any later version.
darkhan@105:
darkhan@105: Foobar is distributed in the hope that it will be useful,
darkhan@105: but WITHOUT ANY WARRANTY; without even the implied warranty
darkhan@105: of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
darkhan@105: See the GNU General Public License for more details.
darkhan@105:
darkhan@105: You should have received a copy of the GNU General Public License
darkhan@105: along with Foobar. If not, see http://www.gnu.org/licenses/.
darkhan@105: """
darkhan@105:
darkhan@105:
Ilia@0: class State(object):
darkhan@11:
is_rusinov@67: def __init__(self, name, symbol, color, key, nums):
darkhan@11: self.name = name
darkhan@11: self.symbol = symbol
darkhan@11: self.color = color
is_rusinov@67: self.key = key
darkhan@11: self.nums = nums
darkhan@11:
darkhan@11: def next_state(self, num):
Ilia@0: return num in self.nums
darkhan@11:
Ilia@0: def __repr__(self):
darkhan@49: return self.symbol + " " + self.name