fix entity position type, fix Entity proto property name clash, and update ts-schema
This commit is contained in:
parent
4cb7d0e1f3
commit
5a000b9327
2 changed files with 44 additions and 12 deletions
|
|
@ -67,7 +67,7 @@ export namespace KafkatorioPacketData {
|
||||||
type: KafkatorioPacketData.Type.EntityUpdate;
|
type: KafkatorioPacketData.Type.EntityUpdate;
|
||||||
key: EntityUpdateKey;
|
key: EntityUpdateKey;
|
||||||
events?: { [key: EventName]: Tick[] } | null;
|
events?: { [key: EventName]: Tick[] } | null;
|
||||||
chunkPosition?: MapChunkPosition | null;
|
chunkPosition?: MapEntityPosition | null;
|
||||||
graphicsVariation?: UByte | null;
|
graphicsVariation?: UByte | null;
|
||||||
health?: Float | null;
|
health?: Float | null;
|
||||||
isActive?: boolean | null;
|
isActive?: boolean | null;
|
||||||
|
|
@ -136,9 +136,9 @@ export interface EntityUpdateKey {
|
||||||
protoType: string;
|
protoType: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MapChunkPosition = [
|
export type MapEntityPosition = [
|
||||||
x: Int,
|
x: Double,
|
||||||
y: Int,
|
y: Double,
|
||||||
];
|
];
|
||||||
|
|
||||||
export type UByte = uint8;
|
export type UByte = uint8;
|
||||||
|
|
@ -178,11 +178,6 @@ export type Colour = [
|
||||||
alpha: Float,
|
alpha: Float,
|
||||||
];
|
];
|
||||||
|
|
||||||
export type MapEntityPosition = [
|
|
||||||
x: Double,
|
|
||||||
y: Double,
|
|
||||||
];
|
|
||||||
|
|
||||||
export type Int = int;
|
export type Int = int;
|
||||||
|
|
||||||
export interface ConfigurationUpdateModData {
|
export interface ConfigurationUpdateModData {
|
||||||
|
|
@ -192,28 +187,65 @@ export interface ConfigurationUpdateModData {
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FactorioPrototype =
|
export type FactorioPrototype =
|
||||||
|
| FactorioPrototype.Entity
|
||||||
| FactorioPrototype.MapTile;
|
| FactorioPrototype.MapTile;
|
||||||
|
|
||||||
export namespace FactorioPrototype {
|
export namespace FactorioPrototype {
|
||||||
export enum Type {
|
export enum Type {
|
||||||
MapTile = "kafkatorio.prototype.MapTile",
|
MapTile = "kafkatorio.prototype.MapTile",
|
||||||
|
Entity = "kafkatorio.prototype.Entity",
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MapTile {
|
export interface MapTile {
|
||||||
type: FactorioPrototype.Type.MapTile;
|
type: FactorioPrototype.Type.MapTile;
|
||||||
name: PrototypeName;
|
name: PrototypeName;
|
||||||
layer: UInt;
|
|
||||||
mapColour: Colour;
|
mapColour: Colour;
|
||||||
|
layer: UInt;
|
||||||
collisionMasks: List;
|
collisionMasks: List;
|
||||||
order: string;
|
order: string;
|
||||||
canBeMined: boolean;
|
canBeMined: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Entity {
|
||||||
|
type: FactorioPrototype.Type.Entity;
|
||||||
|
name: PrototypeName;
|
||||||
|
mapColour: Colour;
|
||||||
|
protoType: string;
|
||||||
|
objectName: string;
|
||||||
|
colour: Colour;
|
||||||
|
maxHealth: Float;
|
||||||
|
isBuilding: boolean;
|
||||||
|
isEntityWithOwner: boolean;
|
||||||
|
isMilitaryTarget: boolean;
|
||||||
|
miningProperties: MiningProperties;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type EventName = string;
|
export type EventName = string;
|
||||||
|
|
||||||
export type Byte = int8;
|
export type Byte = int8;
|
||||||
|
|
||||||
|
export type MapChunkPosition = [
|
||||||
|
x: Int,
|
||||||
|
y: Int,
|
||||||
|
];
|
||||||
|
|
||||||
export type List = any;
|
export type List = any;
|
||||||
|
|
||||||
export type PrototypeKey = Int;
|
export interface MiningProperties {
|
||||||
|
canBeMined: boolean;
|
||||||
|
products: MinedProduct[] | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type PrototypeKey = Int;
|
||||||
|
|
||||||
|
export interface MinedProduct {
|
||||||
|
type: Type;
|
||||||
|
name: PrototypeName;
|
||||||
|
amount: Double | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum Type {
|
||||||
|
item = "item",
|
||||||
|
fluid = "fluid",
|
||||||
|
}
|
||||||
|
|
@ -32,7 +32,7 @@ sealed interface FactorioPrototype {
|
||||||
override val name: PrototypeName,
|
override val name: PrototypeName,
|
||||||
override val mapColour: Colour,
|
override val mapColour: Colour,
|
||||||
|
|
||||||
val type: String,
|
val protoType: String,
|
||||||
val objectName: String,
|
val objectName: String,
|
||||||
val colour: Colour,
|
val colour: Colour,
|
||||||
val maxHealth: Float,
|
val maxHealth: Float,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue