Skip to content

Commit

Permalink
utils circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonBurke committed Feb 15, 2024
1 parent dab8e17 commit b059dc3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/constants/general.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { packCoord } from '../other/codec'
import { randomIntRange } from '../utils/utils'

export enum PlayerRelationships {
ally,
Expand Down Expand Up @@ -1226,6 +1225,10 @@ export const quadAttackMemberOffsets = [
y: 0,
},
]
/**
* @deprecated
* should replace this with something that doesn't create a circular dependency
*/
export const packedQuadAttackMemberOffsets = quadAttackMemberOffsets.map(coord => packCoord(coord))

export enum Result {
Expand Down Expand Up @@ -1440,8 +1443,6 @@ export enum FlagNames {
debugFunneling = 'debugFunneling',
}

export const IDUpdateInterval = randomIntRange(50, 100)

export const creepDamageEvents = new Set([
EVENT_ATTACK_TYPE_MELEE,
EVENT_ATTACK_TYPE_DISMANTLE,
Expand Down
5 changes: 3 additions & 2 deletions src/international/constructionSites.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Sleepable } from 'utils/sleepable'
import { CollectiveManager } from './collective'
import { Utils } from 'utils/utils'
import { IDUpdateInterval } from '../constants/general'
import { Utils, randomIntRange } from 'utils/utils'
import { SegmentsManager } from './segments'

export const IDUpdateInterval = randomIntRange(50, 100)

/**
* Tracks and records constructionSites and thier age, deleting old sites
*/
Expand Down
3 changes: 2 additions & 1 deletion src/international/transactions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Sleepable } from 'utils/sleepable'
import { IDUpdateInterval } from '../constants/general'
import { RoomStatsKeys } from '../constants/stats'
import { randomIntRange, Utils } from 'utils/utils'
import { CollectiveManager } from './collective'
import { SegmentsManager } from './segments'
import { StatsManager } from './stats'

export const IDUpdateInterval = randomIntRange(50, 100)

export class TransactionsManager {
static run() {
if (!Utils.isTickInterval(IDUpdateInterval)) return
Expand Down

0 comments on commit b059dc3

Please sign in to comment.