-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { GameTextForAll, GameTextForPlayer } from "@/wrapper/functions"; | ||
import { BasePlayer } from "../player"; | ||
|
||
export class BaseGameText { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
private _str: string; | ||
public get str(): string { | ||
return this._str; | ||
} | ||
public set str(value: string) { | ||
this._str = value; | ||
} | ||
private _time: number; | ||
public get time(): number { | ||
return this._time; | ||
} | ||
public set time(value: number) { | ||
this._time = value; | ||
} | ||
private _style: number; | ||
public get style(): number { | ||
return this._style; | ||
} | ||
public set style(value: number) { | ||
this._style = value; | ||
} | ||
public constructor(str: string, time: number, style: number) { | ||
this._str = str; | ||
this._time = time; | ||
this._style = style; | ||
} | ||
forAll() { | ||
GameTextForAll(this.str, this.time, this.style); | ||
} | ||
forPlayer<P extends BasePlayer>(player: P) { | ||
GameTextForPlayer(player.id, this.str, this.time, this.style); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters