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;
|
||||
key: EntityUpdateKey;
|
||||
events?: { [key: EventName]: Tick[] } | null;
|
||||
chunkPosition?: MapChunkPosition | null;
|
||||
chunkPosition?: MapEntityPosition | null;
|
||||
graphicsVariation?: UByte | null;
|
||||
health?: Float | null;
|
||||
isActive?: boolean | null;
|
||||
|
|
@ -136,9 +136,9 @@ export interface EntityUpdateKey {
|
|||
protoType: string;
|
||||
}
|
||||
|
||||
export type MapChunkPosition = [
|
||||
x: Int,
|
||||
y: Int,
|
||||
export type MapEntityPosition = [
|
||||
x: Double,
|
||||
y: Double,
|
||||
];
|
||||
|
||||
export type UByte = uint8;
|
||||
|
|
@ -178,11 +178,6 @@ export type Colour = [
|
|||
alpha: Float,
|
||||
];
|
||||
|
||||
export type MapEntityPosition = [
|
||||
x: Double,
|
||||
y: Double,
|
||||
];
|
||||
|
||||
export type Int = int;
|
||||
|
||||
export interface ConfigurationUpdateModData {
|
||||
|
|
@ -192,28 +187,65 @@ export interface ConfigurationUpdateModData {
|
|||
}
|
||||
|
||||
export type FactorioPrototype =
|
||||
| FactorioPrototype.Entity
|
||||
| FactorioPrototype.MapTile;
|
||||
|
||||
export namespace FactorioPrototype {
|
||||
export enum Type {
|
||||
MapTile = "kafkatorio.prototype.MapTile",
|
||||
Entity = "kafkatorio.prototype.Entity",
|
||||
}
|
||||
|
||||
export interface MapTile {
|
||||
type: FactorioPrototype.Type.MapTile;
|
||||
name: PrototypeName;
|
||||
layer: UInt;
|
||||
mapColour: Colour;
|
||||
layer: UInt;
|
||||
collisionMasks: List;
|
||||
order: string;
|
||||
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 Byte = int8;
|
||||
|
||||
export type MapChunkPosition = [
|
||||
x: Int,
|
||||
y: Int,
|
||||
];
|
||||
|
||||
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 mapColour: Colour,
|
||||
|
||||
val type: String,
|
||||
val protoType: String,
|
||||
val objectName: String,
|
||||
val colour: Colour,
|
||||
val maxHealth: Float,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue