#! /usr/bin/env python # Rayito # Copyright (C) 2011 Gabriel Eirea # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Contact information: # Gabriel Eirea geirea@gmail.com # Ceibal Jam http://ceibaljam.org class RtoTimeLine(): """ Class for a time line that builds the script. """ def __init__(self): self._time_line = [] def add_event(self, time, obj, event, params = None): # TBD: check that obj has event self._time_line.append([time, obj, event, params]) self._time_line.sort() def get_time(self, index): return self._time_line[index][0] def get_object(self, index): return self._time_line[index][1] def get_event(self, index): return self._time_line[index][2] def get_params(self, index): return self._time_line[index][3] def get_length(self): return len(self._time_line) def check_correctness(self): # TBD pass