Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rayito/RtoTimeLine.py
diff options
context:
space:
mode:
Diffstat (limited to 'rayito/RtoTimeLine.py')
-rwxr-xr-xrayito/RtoTimeLine.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/rayito/RtoTimeLine.py b/rayito/RtoTimeLine.py
new file mode 100755
index 0000000..0892b5d
--- /dev/null
+++ b/rayito/RtoTimeLine.py
@@ -0,0 +1,53 @@
+#! /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 <http://www.gnu.org/licenses/>.
+#
+# 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