timetable

The main timetable and the skool clock.

class pyskool.timetable.Timetable(config)

Represents the timetable of lessons, and the skool clock that ticks down until the bell rings.

Parameters:config (dict) – Configuration parameters from the ini file.
add_lesson(lesson_id)

Add a lesson to the timetable.

Parameters:lesson_id – The ID of the lesson.
add_lesson_details(lesson_id, hide_teacher, teacher_id, room_id)

Add the details of a lesson to the timetable.

Parameters:
  • lesson_id – The ID of the lesson.
  • hide_teacher – If True, the teacher’s name (if any) will not be printed in the lesson box for this period.
  • teacher_id – The ID of the teacher supervising Eric for this period, or an empty string if it is unsupervised.
  • room_id – The ID of the room in which the lesson takes place, or the name of the period (such as PLAYTIME) if it is unsupervised.
add_special_playtime(lesson_id)

Add a special playtime. Special playtimes do not appear in the main timetable (though they could be inserted); occasionally a normal playtime in the main timetable will be replaced by a special playtime.

Parameters:lesson_id – The ID of the special playtime.
get_room_id()

Return the ID of the room Eric’s will be expected to show up in at some point during the current period, or else the name of the period (such as PLAYTIME).

get_teacher_id()

Return the ID of the teacher supervising Eric for the current period, or an empty string if it is an unsupervised period.

hide_teacher()

Return whether the teacher’s name (if any) should be displayed in the lesson box for the current period. This is generally True for classroom periods, and False for any other period (supervised or otherwise).

is_assembly()

Return whether it’s Assembly.

is_playtime()

Return whether it’s Playtime.

is_teaching_eric(character)

Return whether a character is supervising Eric during the current period.

Parameters:character (Character) – The character to check.
is_time_remaining(ticks)

Return whether there is no more than a certain number of skool clock ticks remaining before the bell rings.

Parameters:ticks – The number of ticks.
is_time_to_get_along()

Return whether Eric should have left the classroom he was in last period by now.

is_time_to_start_lesson()

Return whether it’s time to start a lesson. When the answer is True, teachers will stop pacing up and down outside classroom doorways.

next_lesson()

Proceed to the next lesson in the timetable. If the next lesson is playtime and there are any special playtimes defined, one of those may be chosen as the next lesson.

reinitialise()

Reinitialise the timetable after a game has ended.

resume(ticks)

Start the skool clock with a certain number of ticks remaining till the bell rings. If the clock was previously stopped (see stop()), it will start ticking again.

Parameters:ticks – The number of ticks.
rewind(ticks)

Rewind the skool clock by a number of ticks.

Parameters:ticks – The number of ticks.
stop()

Stop the skool clock. Any further attempts to make it tick will be futile until resume() is called.

tick()

Advance the skool clock by one tick (unless the clock has been stopped).

Returns:True if it’s time for the bell to ring, False otherwise.
up_a_year()

Take appropriate action when Eric has gone up a year. This entails setting the skool clock so that half a normal lesson length remains before the bell will ring.

Previous topic

stinkbomb

Next topic

water