Compare commits
No commits in common. "ee4dbc0428b619ed6b6ff03be57427f38933b4e2" and "f5f6b31394769c6e8f9e5abfcc93287f4121693f" have entirely different histories.
ee4dbc0428
...
f5f6b31394
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@og/processor",
|
|
||||||
"type": "module",
|
|
||||||
"main": "index.mjs",
|
|
||||||
"dependencies": {
|
|
||||||
"@og/binary-struct": "file:../shared/bstruct",
|
|
||||||
"@og/utility": "file:../shared/utility",
|
|
||||||
"@og/error-utils": "file:../shared/error-utils"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
import { Queue } from '@og/utility';
|
|
||||||
|
|
||||||
/** @typedef {import('../shared/player.mjs').Player} Player */
|
|
||||||
/** @typedef {import('../shared/team.mjs').Team} Team */
|
|
||||||
|
|
||||||
export class PlayerState {
|
|
||||||
/** @type {Player} */
|
|
||||||
id;
|
|
||||||
|
|
||||||
/** @type {Team} */
|
|
||||||
team;
|
|
||||||
|
|
||||||
/** @type {boolean} */
|
|
||||||
is_defeated = false;
|
|
||||||
|
|
||||||
/** @type {Queue} */
|
|
||||||
orders = new Queue();
|
|
||||||
|
|
||||||
constructor(id, team) {
|
|
||||||
this.id = id;
|
|
||||||
this.team = team;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export class GameBoard {
|
|
||||||
// TODO
|
|
||||||
};
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
import { BASIC_TYPES } from '@og/binary-struct';
|
|
||||||
|
|
||||||
/** @typedef {number} Direction */
|
|
||||||
|
|
||||||
export const DIRECTION = {
|
|
||||||
N: 0x00,
|
|
||||||
S: 0x01,
|
|
||||||
W: 0x02,
|
|
||||||
E: 0x03,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const TYPEDEF_Direction = BASIC_TYPES.u8;
|
|
||||||
|
|
||||||
export const DIRECTION_DELTA_X = [ /* TODO */ ];
|
|
||||||
export const DIRECTION_DELTA_Y = [ /* TODO */ ];
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
/** @typedef {import('./player.mjs').Player} Player */
|
|
||||||
/** @typedef {import('./direction.mjs').Direction} Direction */
|
|
||||||
/** @typedef {import('./pos.mjs').PosT} PosT */
|
|
||||||
|
|
||||||
export class PlayerMove {
|
|
||||||
/** @type {Player} */
|
|
||||||
player;
|
|
||||||
|
|
||||||
/** @type {PosT} */
|
|
||||||
x;
|
|
||||||
|
|
||||||
/** @type {PosT} */
|
|
||||||
y;
|
|
||||||
|
|
||||||
/** @type {Direction} */
|
|
||||||
dir;
|
|
||||||
|
|
||||||
/** @type {boolean} */
|
|
||||||
is_half = false;
|
|
||||||
|
|
||||||
isValid() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
get tx() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
get ty() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import { BASIC_TYPES } from '@og/binary-struct';
|
|
||||||
|
|
||||||
/** @typedef {number} Player */
|
|
||||||
|
|
||||||
/** @type {Player} */
|
|
||||||
export const NEUTRAL_PLAYER = 0;
|
|
||||||
|
|
||||||
export const TYPEDEF_Player = BASIC_TYPES.u8;
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import { BASIC_TYPES } from '@og/binary-struct';
|
|
||||||
|
|
||||||
/** @typedef {number} PosT */
|
|
||||||
|
|
||||||
export const TYPEDEF_PosT = BASIC_TYPES.u8;
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import { BASIC_TYPES } from '@og/binary-struct';
|
|
||||||
|
|
||||||
/** @typedef {number} Team */
|
|
||||||
|
|
||||||
/** @type {Team} */
|
|
||||||
export const NEUTRAL_TEAM = 0;
|
|
||||||
|
|
||||||
export const TYPEDEF_Team = BASIC_TYPES.u8;
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
import { NEUTRAL_PLAYER, TYPEDEF_Player } from './player.mjs';
|
|
||||||
import { TYPEDEF_Unit } from './unit.mjs';
|
|
||||||
import { BASIC_TYPES } from '@og/binary-struct';
|
|
||||||
|
|
||||||
/** @typedef {import('./player.mjs').Player} Player */
|
|
||||||
/** @typedef {import('./unit.mjs').Unit} Unit */
|
|
||||||
|
|
||||||
/** @typedef {number} TileType */
|
|
||||||
|
|
||||||
export const TILE_TYPE = {
|
|
||||||
misty: 0x00,
|
|
||||||
mountain: 0x01,
|
|
||||||
stronghold: 0x02,
|
|
||||||
blank: 0x03,
|
|
||||||
capital: 0x04,
|
|
||||||
swamp: 0x05,
|
|
||||||
isValid: (type) => (0 <= type && type <= 5),
|
|
||||||
};
|
|
||||||
|
|
||||||
export const TYPEDEF_TileType = BASIC_TYPES.u8;
|
|
||||||
|
|
||||||
export class Tile {
|
|
||||||
/** @type {Player} */
|
|
||||||
owner = NEUTRAL_PLAYER;
|
|
||||||
|
|
||||||
/** @type {TileType} */
|
|
||||||
type = TILE_TYPE.misty;
|
|
||||||
|
|
||||||
/** @type {Unit} */
|
|
||||||
unit = 0;
|
|
||||||
|
|
||||||
static typedef = [
|
|
||||||
{ field: 'owner', type: TYPEDEF_Player },
|
|
||||||
{ field: 'type', type: TYPEDEF_TileType },
|
|
||||||
{ field: 'unit', type: TYPEDEF_Unit },
|
|
||||||
];
|
|
||||||
};
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import { BASIC_TYPES } from '@og/binary-struct';
|
|
||||||
|
|
||||||
/** @typedef {number} Unit */
|
|
||||||
|
|
||||||
export const TYPEDEF_Unit = BASIC_TYPES.i32;
|
|
||||||
@ -23,7 +23,7 @@ function calcAccountUUID(handle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Model representing an user account.
|
* A Model repersenting an user account.
|
||||||
* @class
|
* @class
|
||||||
* @extends {BaseModel}
|
* @extends {BaseModel}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user