EditorRules beta
Class of @v12-engine/editor
export declare class EditorRulesThe map's rules (campaign plan MS1): a list kept in its data (GameMap.data.rules, MissionRule) that the mission rules pack runs (missionRules): each when a condition of the computer players' language holds, do its actions. Each change one step of the history. What the Rules panel does, in code; the names it offers (the map's regions and objectives, the game's prefabs and cinematics, the view's speakers) are here too
A part of the editor, as it gives it (editor.rules)
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the EditorRules class.
Members
add
add(rule?: Partial<MissionRule>): number;Adds a rule at the end: fired once, when a region of the map has a unit in it (the first region, else after a second), doing nothing yet, with an id of its own (rule.<n>); or what rule says of it. Gives back its place
addAction
addAction(which: number | string, action?: MissionActionData): void;Adds an action to a rule, at the end: the one given, else an objective of the map's given (the first by a rule, else the first)
blank
blank(kind: (typeof RULE_ACTIONS)[number]): MissionActionData;An action of each kind as it starts out, with the map's and the game's first names in it
cinematics
cinematics(): string[];The cinematics a rule may play: the view's, and those there are files of
indexOf
indexOf(which: number | string): number;The place of a rule in the list, by its place or by its id (the first with it): -1 for none
list
list(): MissionRule[];The map's rules, in their order, as it keeps them: one with no id or no condition too
move
move(from: number, to: number): void;Moves a rule to another place in the list: the order they are checked in
places
places(): string[];The places of the map a rule may name: its points and regions, and what is placed and named, in that order
prefabs
prefabs(): {
id: string;
name: string;
}[];The game's prefabs a rule may spawn, by id and name
remove
remove(which: number | string): void;Takes a rule away, by its place or its id
removeAction
removeAction(which: number | string, at: number): void;Takes an action away from a rule, by its place
run
run(): boolean;Whether the game runs the map's rules: it has the mission rules pack (missionRules)
set
set(which: number | string, change: Partial<MissionRule>): void;Changes a rule, by its place or its id: every: undefined takes away its repeating, as: undefined asks it as the first person again
setAction
setAction(which: number | string, at: number, action: MissionActionData): void;Changes one action of a rule, by their places: what kind it is, or its fields
speakers
speakers(): string[];The speakers of the view's (GameView.cinematics.speakers) a line may be said by