2021-04-10 00:12:31 +02:00
|
|
|
import * as React from "react";
|
2021-09-05 01:09:30 +02:00
|
|
|
import { IPlayer } from "../PersonObjects/IPlayer";
|
2021-09-25 20:42:57 +02:00
|
|
|
import { dialogBoxCreate } from "../ui/React/DialogBox";
|
2021-04-10 00:12:31 +02:00
|
|
|
|
|
|
|
const gainLimit = 10e9;
|
|
|
|
|
2021-10-01 07:00:50 +02:00
|
|
|
export function win(p: IPlayer, n: number): void {
|
2021-10-27 20:18:33 +02:00
|
|
|
p.gainMoney(n, "casino");
|
2021-10-01 07:00:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function reachedLimit(p: IPlayer): boolean {
|
|
|
|
const reached = p.getCasinoWinnings() > gainLimit;
|
|
|
|
if (reached) {
|
|
|
|
dialogBoxCreate(<>Alright cheater get out of here. You're not allowed here anymore.</>);
|
|
|
|
}
|
|
|
|
return reached;
|
|
|
|
}
|
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
export class Game<T, U> extends React.Component<T, U> {
|
|
|
|
win(p: IPlayer, n: number): void {
|
2021-10-27 20:18:33 +02:00
|
|
|
p.gainMoney(n, "casino");
|
2021-09-05 01:09:30 +02:00
|
|
|
}
|
2021-04-10 00:12:31 +02:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
reachedLimit(p: IPlayer): boolean {
|
|
|
|
const reached = p.getCasinoWinnings() > gainLimit;
|
|
|
|
if (reached) {
|
2021-09-09 05:47:34 +02:00
|
|
|
dialogBoxCreate(<>Alright cheater get out of here. You're not allowed here anymore.</>);
|
2021-09-05 01:09:30 +02:00
|
|
|
}
|
|
|
|
return reached;
|
|
|
|
}
|
|
|
|
}
|