forked from Terra-rian/snakecord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
83 lines (77 loc) · 1.96 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import { Message, ColorResolvable } from 'discord.js';
export interface SnakeGameOptions {
/**
* The title to display on the game embed.
*/
title?: string;
/**
* The title to display when the game has ended.
*/
gameOverTitle?: string;
/**
* The emoji to use as the background for the game embed.
*/
// backgroundEmoji?: EmojiIdentifierResolvable;
/**
* The emoji to use as the snake head / body for the game.
*/
// snakeEmoji?: EmojiIdentifierResolvable;
/**
* The emoji to use as the fruit for the game embed.
*/
// fruitEmoji?: EmojiIdentifierResolvable;
/**
* Whether or not to display the timestamp on the game embed.
*/
timestamp?: boolean;
/**
* The color on the side of the game embed.
*/
color?: ColorResolvable;
/**
* How wide the game board should be (5 ~ 20 units).
*/
// boardWidth?: number;
/**
* How long the game board should be (5 ~ 20 units).
*/
// boardLength?: number;
}
export interface EntityLocation {
/**
* The `X` coordinate of the entity.
*/
x: number;
/**
* The `Y` coordinate of the entity.
*/
y: number;
}
export class SnakeGame {
// Properties
// boardWidth: number;
// boardLength: number;
// gameBoard: string[];
// apple: EntityLocation;
snake: EntityLocation[];
snakeLength: number;
score: number;
gameEmbedMessage: Message;
inGame: boolean;
options: SnakeGameOptions;
// Constructor
constructor(options?: SnakeGameOptions);
// Methods
gameBoardToString(): string;
isLocationInSnake(pos: EntityLocation): boolean;
newAppleLocation(): void;
newGame(msg: Message): void;
step(): void;
gameOver(): void;
waitForReaction(): void;
// Setters
setTitle(title: string): this;
setGameOverTitle(title: string): this;
setColor(color: ColorResolvable): this;
setTimestamp(): this;
}