Class Schedule.Builder
java.lang.Object
me.gamercoder215.mobchip.ai.schedule.Schedule.Builder
- Enclosing class:
Schedule
Builder class for making a
Schedule
-
Method Summary
Modifier and TypeMethodDescriptionaddActivity
(int time, @NotNull Activity activity) Adds an Activity to the Schedule.build()
Builds the Schedule.Fetches the current Timeline as a map in this builder.
-
Method Details
-
addActivity
public Schedule.Builder addActivity(int time, @NotNull @NotNull Activity activity) throws IllegalArgumentException Adds an Activity to the Schedule.- Parameters:
time
- Timestamp of activity, in ticksactivity
- Activity to add- Returns:
- this builder, for chaining
- Throws:
IllegalArgumentException
- if time is not between 0 and 24000 or if activity is null
-
getTimeline
Fetches the current Timeline as a map in this builder.- Returns:
- Current Timeline
-
build
Builds the Schedule.- Returns:
- Built Schedule
- Throws:
IllegalArgumentException
- if timeline is empty
-