Skip to content

Commit

Permalink
Partially upgraded arrows.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Naviary3 authored Jan 25, 2025
1 parent 41e84cb commit 37c82e6
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 116 deletions.
5 changes: 3 additions & 2 deletions src/client/scripts/esm/chess/logic/gamefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import wincondition from './wincondition.js';
import gamerules from '../variants/gamerules.js';
// Type Definitions...

/** @typedef {import('../../util/math.js').Vec2} Vec2 */
/** @typedef {import('../../util/math.js').BoundingBox} BoundingBox */
/** @typedef {import('./movepiece.js').Move} Move */
/** @typedef {import('../../game/rendering/buffermodel.js').BufferModel} BufferModel */
Expand All @@ -23,7 +24,7 @@ import gamerules from '../variants/gamerules.js';
/** @typedef {import('./organizedlines.js').PiecesByKey} PiecesByKey */
/** @typedef {import('./organizedlines.js').LinesByStep} LinesByStep */

'use strict';
'use strict';

/**
* Constructs a gamefile from provided arguments. Use the *new* keyword.
Expand Down Expand Up @@ -63,7 +64,7 @@ function gamefile(metadata, { moves = [], variantOptions, gameConclusion, clockV
box: undefined,
/** A set of all types of pieces that are in this game, without their color extension: `['pawns','queens']` @type {string[]} */
existingTypes: undefined,
/** Possible sliding moves in this game, dependant on what pieces there are: `[[1,1],[1,0]]` @type {Coords[]}*/
/** Possible sliding moves in this game, dependant on what pieces there are: `[[1,1],[1,0]]` @type {Vec2[]}*/
slidingPossible: undefined,
/** Whether hippogonal lines, or greater, are present in the gamefile.
* True if there are knightriders, or greater, riders. @type {boolean} */
Expand Down
4 changes: 2 additions & 2 deletions src/client/scripts/esm/chess/logic/organizedlines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function getXFromLine(step: Coords, coords: Coords): number {
}

/** Splits the `C` value out of the line key */
function getCFromKey(lineKey: LineKey): number {
function getXFromKey(lineKey: LineKey): number {
return Number(lineKey.split('|')[0]);
}

Expand Down Expand Up @@ -408,7 +408,7 @@ export default {
buildStateFromKeyList,
getKeyFromLine,
getCFromLine,
getCFromKey,
getXFromKey,
areColinearSlidesPresentInGame,
areHippogonalsPresentInGame,
};
Loading

0 comments on commit 37c82e6

Please sign in to comment.