@wayward/types 2.11.0-beta.dev.20211212.1 → 2.11.0-beta.dev.20211212.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,7 @@ import type ITextureDebugRenderer from "renderer/ITextureDebugRenderer";
33
33
  import type WebGlContext from "renderer/WebGlContext";
34
34
  import ReplayManager from "replay/ReplayManager";
35
35
  import type { IOptions } from "save/data/ISaveDataGlobal";
36
+ import type StringTokenizer from "save/serializer/StringTokenizer";
36
37
  import ItemStylesheetHandler from "ui/screen/screens/game/util/item/ItemStylesheet";
37
38
  import type { IVersionInfo } from "utilities/Version";
38
39
  export declare class Game extends EventEmitter.Host<IGameEvents> {
@@ -78,6 +79,7 @@ export declare class Game extends EventEmitter.Host<IGameEvents> {
78
79
  private queueDedicatedServerFovUpdate?;
79
80
  private gameOptionsCached?;
80
81
  private synchronizeStateId;
82
+ protected stringTokenizer: StringTokenizer | undefined;
81
83
  initializeRenderer(): void;
82
84
  globalSlotReady(): void;
83
85
  /**
@@ -264,11 +264,7 @@ export default class Doodad extends EventEmitter.Host<IDoodadEvents> implements
264
264
  /**
265
265
  * Gives civilization score based on how much is defined for this doodad.
266
266
  */
267
- addCivilizationScore(): void;
268
- /**
269
- * Reduces civilization score based on how much is defined for this doodad.
270
- */
271
- reduceCivilizationScore(): void;
267
+ changeCivilizationScore(add: boolean): void;
272
268
  /**
273
269
  * Decay over time
274
270
  */
@@ -10,8 +10,8 @@
10
10
  */
11
11
  import { MoveType } from "game/entity/IEntity";
12
12
  import type Player from "game/entity/player/Player";
13
- import type { IPreSerializeCallback, IUnserializedCallback } from "save/serializer/ISerializer";
14
- export default class FlowField implements IPreSerializeCallback, IUnserializedCallback {
13
+ import type { IPreSerializeCallback } from "save/serializer/ISerializer";
14
+ export default class FlowField implements IPreSerializeCallback {
15
15
  readonly x: number;
16
16
  readonly y: number;
17
17
  readonly z: number;
@@ -25,12 +25,18 @@ export default class FlowField implements IPreSerializeCallback, IUnserializedCa
25
25
  constructor(x: number | undefined, y: number, z: number, size: number, moveType: MoveType);
26
26
  toString(): string;
27
27
  preSerializeObject(): void;
28
- onUnserialized(): void;
28
+ load(): void;
29
+ unload(): void;
29
30
  getZ(): number;
30
- delete(): void;
31
31
  getHashCodes(): string[];
32
32
  getFieldValue(x: number, y: number): number;
33
33
  updateField(flowFieldPlayers: Player[]): void;
34
34
  resetPenalty(gridIndex: number): void;
35
35
  reset(): void;
36
+ /**
37
+ * The pointer to the views might change when emscripten grows memory
38
+ * So we need to refetch it sometimes
39
+ * The array length is 0 when the view is invalid
40
+ */
41
+ private updateViews;
36
42
  }
@@ -24,13 +24,14 @@ export default class FlowFieldManager {
24
24
  private _flowFieldPlayers;
25
25
  constructor(island: Island, size: number);
26
26
  private get flowFieldPlayers();
27
+ load(): void;
28
+ unload(): void;
27
29
  /**
28
30
  * Remove the player from the flow field when they leave the game
29
31
  * Using preRemove because we are relying on the player id
30
32
  */
31
33
  protected onPlayerIdChanged(player: Player, currentId: number, newId: number, isAbsentPlayer: boolean): void;
32
34
  protected onMoveToIsland(player: Player, oldIsland: Island): void;
33
- delete(): void;
34
35
  setDelegate(delegate: DebugRendererDelegate): void;
35
36
  getWidth(): number;
36
37
  getHeight(): number;
@@ -238,6 +238,10 @@ export default class Island extends EventEmitter.Host<IIslandEvents> implements
238
238
  * @param point x/y/z of the water tile created.
239
239
  */
240
240
  contaminateWater(point: IVector3): void;
241
+ /**
242
+ * Gives civilization score based on how much is defined for this tile's terrain.
243
+ */
244
+ changeCivilizationScore(score: number, source: string): void;
241
245
  processTickFlags(tickFlag: TickFlag, ticks: number, realPlayers: Player[]): void;
242
246
  processTickFlagsAsync(tickFlag: TickFlag, ticks: number, realPlayers: Player[], onProgress: (progess: number) => Promise<void>): Promise<void>;
243
247
  private updateEntityFov;
@@ -63,40 +63,42 @@ export declare enum MultiplayerSyncCheck {
63
63
  HealthChange = 25,
64
64
  InventoryCount = 26,
65
65
  Island = 27,
66
- Islands = 28,
67
- IsTileEmpty = 29,
68
- Item = 30,
69
- ItemCraft = 31,
70
- ItemDamage = 32,
71
- ItemOrder = 33,
72
- LastCreationIds = 34,
73
- MilestoneSeed = 35,
74
- Misc = 36,
75
- MoveToTile = 37,
76
- PenaltyFieldHashCode = 38,
77
- PlaceOnTile = 39,
78
- PlayerManager = 40,
79
- PlayerPositions = 41,
80
- Players = 42,
81
- PlayerSetup = 43,
82
- Random = 44,
83
- Reputation = 45,
84
- Seed = 46,
85
- SeededGenerator = 47,
86
- SkillGain = 48,
87
- StaminaChanges = 49,
88
- StatChange = 50,
89
- Stats = 51,
90
- StatusChange = 52,
91
- StatusEffect = 53,
92
- SyncChecks = 54,
93
- TemperatureManager = 55,
94
- Temporary = 56,
95
- Tick = 57,
96
- TileEvent = 58,
97
- Time = 59,
98
- UpdateDirection = 60,
99
- Weight = 61
66
+ IslandCivilizationScore = 28,
67
+ Islands = 29,
68
+ IsTileEmpty = 30,
69
+ Item = 31,
70
+ ItemCraft = 32,
71
+ ItemDamage = 33,
72
+ ItemOrder = 34,
73
+ LastCreationIds = 35,
74
+ Merchant = 36,
75
+ MilestoneSeed = 37,
76
+ Misc = 38,
77
+ MoveToTile = 39,
78
+ PenaltyFieldHashCode = 40,
79
+ PlaceOnTile = 41,
80
+ PlayerManager = 42,
81
+ PlayerPositions = 43,
82
+ Players = 44,
83
+ PlayerSetup = 45,
84
+ Random = 46,
85
+ Reputation = 47,
86
+ Seed = 48,
87
+ SeededGenerator = 49,
88
+ SkillGain = 50,
89
+ StaminaChanges = 51,
90
+ StatChange = 52,
91
+ Stats = 53,
92
+ StatusChange = 54,
93
+ StatusEffect = 55,
94
+ SyncChecks = 56,
95
+ TemperatureManager = 57,
96
+ Temporary = 58,
97
+ Tick = 59,
98
+ TileEvent = 60,
99
+ Time = 61,
100
+ UpdateDirection = 62,
101
+ Weight = 63
100
102
  }
101
103
  export declare const maxPlayers = 32;
102
104
  export declare const packetTickRate = 16;
@@ -44,7 +44,7 @@ export interface ISaveObject {
44
44
  }
45
45
  export interface ISerializeProperty {
46
46
  property: string[];
47
- enableStringTokenization?: boolean;
47
+ stringTokenizationProperty?: string;
48
48
  enableTypesStats?: boolean;
49
49
  skipCompression?: boolean;
50
50
  savePropertyFlag?: SavePropertyFlag;
@@ -35,7 +35,7 @@ export interface ISerializerOptions {
35
35
  disableJitDeserialization?: boolean;
36
36
  enableDuplicateObjectDetection?: boolean;
37
37
  enableTypesStats?: boolean;
38
- enableStringTokenization?: boolean;
38
+ stringTokenizationProperty?: string;
39
39
  forceSuccess?: boolean;
40
40
  swallowErrors?: boolean;
41
41
  }
@@ -13,7 +13,7 @@ import { SerializerMetadataKey, SavePropertyFlag, Types } from "save/serializer/
13
13
  import StringTokenizer from "save/serializer/StringTokenizer";
14
14
  export default class Serializer implements ISerializer {
15
15
  private readonly options;
16
- private readonly stringTokenizer?;
16
+ stringTokenizer?: StringTokenizer | undefined;
17
17
  static convertStringToUint8Array(data: string): Uint8Array;
18
18
  private static array;
19
19
  private static usingArray;
@@ -17,6 +17,7 @@ export default class StringTokenizer {
17
17
  private static readonly tokenizableStrings;
18
18
  static registerTarget(target: any): void;
19
19
  static initialize(): void;
20
+ static create(): StringTokenizer;
20
21
  /**
21
22
  * String -> Token. Used when writing string tokens during serialization
22
23
  */
@@ -25,10 +26,7 @@ export default class StringTokenizer {
25
26
  * Token -> String mapping. Used when reading string tokens during deserialization
26
27
  */
27
28
  private readonly tokenToString;
28
- /**
29
- * Constructs the mappings
30
- */
31
- constructor();
29
+ clear(): void;
32
30
  /**
33
31
  * Writes the token for the string if it has one
34
32
  * @param serializer Serializer object
@@ -50,9 +50,7 @@ export declare class Ui extends EventEmitter.Host<IUiEvents> {
50
50
  readonly promptsBridge: PromptsBridge;
51
51
  private storage;
52
52
  private readonly dataHosts;
53
- private hqUnsupportedColors;
54
53
  constructor();
55
- colorSupportsHQFontRendering(colorID?: string | null): boolean;
56
54
  /**
57
55
  * @param elements The elements to refresh translations inside
58
56
  */
@@ -94,5 +92,4 @@ export declare class Ui extends EventEmitter.Host<IUiEvents> {
94
92
  protected onReload(api: IBindHandlerApi): boolean;
95
93
  protected onToggleDevTools(): boolean;
96
94
  protected onReloadStylesheets(): boolean;
97
- private cacheHQUnsupportedColors;
98
95
  }
@@ -10,8 +10,7 @@
10
10
  */
11
11
  declare enum UiExperiment {
12
12
  ColorSchemeLight = 0,
13
- HqFontRendering = 1,
14
- NewCraftingDialog = 2
13
+ NewCraftingDialog = 1
15
14
  }
16
15
  declare module UiExperiment {
17
16
  type Excluded = "toggle" | "update" | "all" | "name";
@@ -91,11 +91,7 @@ declare module TileHelpers {
91
91
  /**
92
92
  * Gives civilization score based on how much is defined for this tile's terrain.
93
93
  */
94
- function addCivilizationScore(island: Island, point: IVector3): void;
95
- /**
96
- * Reduces civilization score based on how much is defined for this tile's terrain.
97
- */
98
- function reduceCivilizationScore(island: Island, point: IVector3): void;
94
+ function changeCivilizationScore(island: Island, x: number, y: number, z: number, add: boolean): void;
99
95
  /**
100
96
  * Check if a tile is a suitable spawn point
101
97
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.11.0-beta.dev.20211212.1",
4
+ "version": "2.11.0-beta.dev.20211212.2",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",