Skip to content

Commit

Permalink
feat: game text class
Browse files Browse the repository at this point in the history
  • Loading branch information
dockfries committed Sep 7, 2022
1 parent 36d339a commit 6d591d0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/controllers/gametext/index.ts
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);
}
}
1 change: 1 addition & 0 deletions src/controllers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from "./player";
export * from "./vehicle";
export * from "./gamemode";
export * from "./netstats";
export * from "./gametext";

0 comments on commit 6d591d0

Please sign in to comment.