Skip to content

Commit

Permalink
refactor: addStat --> addPlayerStat
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamiell committed Sep 4, 2023
1 parent 3ab6cdb commit af9ebb6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions packages/docs/docs/main/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ This page lists the changes to the IsaacScript framework.

<br />

## September 11th, 2023 (Unreleased)

- Renamed the following helper functions:
- `addStat` --> `addPlayerStat`

## September 4th, 2023

- Added the following helper functions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CacheFlag, PlayerType } from "isaac-typescript-definitions";
import { ModCallback } from "isaac-typescript-definitions";
import { Exported } from "../../../decorators";
import { addStat, getDefaultPlayerStat } from "../../../functions/stats";
import { addPlayerStat, getDefaultPlayerStat } from "../../../functions/stats";
import { Feature } from "../../private/Feature";

type StatMap = Map<CacheFlag, number> | ReadonlyMap<CacheFlag, number>;
Expand Down Expand Up @@ -38,7 +38,7 @@ export class CharacterStats extends Feature {
}
const delta = stat - defaultStat;

addStat(player, cacheFlag, delta);
addPlayerStat(player, cacheFlag, delta);
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
mapGetPlayer,
mapSetPlayer,
} from "../../../functions/playerDataStructures";
import { getPlayerStats } from "../../../functions/playerStats";
import { isEden } from "../../../functions/players";
import { getPlayerStats } from "../../../functions/stats";
import type { PlayerStats } from "../../../interfaces/PlayerStats";
import type { PlayerIndex } from "../../../types/PlayerIndex";
import { Feature } from "../../private/Feature";
Expand Down
2 changes: 1 addition & 1 deletion packages/isaacscript-common/src/functions/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const STAT_CACHE_FLAGS_SET = new ReadonlySet<CacheFlag>([
* - CacheFlag.SPEED (1 << 4)
* - CacheFlag.LUCK (1 << 10)
*/
export function addStat(
export function addPlayerStat(
player: EntityPlayer,
cacheFlag: CacheFlag,
amount: number,
Expand Down
1 change: 0 additions & 1 deletion packages/isaacscript-common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export * from "./functions/playerCenter";
export * from "./functions/playerDataStructures";
export * from "./functions/playerHealth";
export * from "./functions/playerIndex";
export * from "./functions/playerStats";
export * from "./functions/players";
export * from "./functions/pocketItems";
export * from "./functions/positionVelocity";
Expand Down

0 comments on commit af9ebb6

Please sign in to comment.