diff --git a/src/converters/furnituredata/FurnitureDataConverter.ts b/src/converters/furnituredata/FurnitureDataConverter.ts index 6acd071..f1d15b5 100644 --- a/src/converters/furnituredata/FurnitureDataConverter.ts +++ b/src/converters/furnituredata/FurnitureDataConverter.ts @@ -13,6 +13,8 @@ import { FurnitureDataDownloader } from './FurnitureDataDownloader'; @singleton() export class FurnitureDataConverter extends Converter { + public furnitureData: IFurnitureData = null; + constructor( private readonly _furnitureDataDownloader: FurnitureDataDownloader, private readonly _configuration: Configuration, @@ -47,8 +49,14 @@ export class FurnitureDataConverter extends Converter const furnitureData = await this.mapXML2JSON(xml); + this.furnitureData = furnitureData; + furnitureDataString = JSON.stringify(furnitureData); } + else + { + this.furnitureData = JSON.parse(furnitureDataString); + } const path = directory.path + '/FurnitureData.json'; diff --git a/src/mapping/json/asset/IAssetData.ts b/src/mapping/json/asset/IAssetData.ts index 4848fa3..058e21c 100644 --- a/src/mapping/json/asset/IAssetData.ts +++ b/src/mapping/json/asset/IAssetData.ts @@ -3,9 +3,9 @@ import { IAsset } from './IAsset'; import { IAssetAlias } from './IAssetAlias'; import { IAssetDimension } from './IAssetDimension'; import { IAssetPalette } from './IAssetPalette'; +import { ISoundSample } from './ISoundSample'; import { ISpritesheetData } from './spritesheet'; import { IAssetVisualizationData } from './visualization'; -import {ISoundSample} from "./ISoundSample"; export interface IAssetData { type?: string; diff --git a/src/mapping/json/asset/IAssetPalette.ts b/src/mapping/json/asset/IAssetPalette.ts index 5102e95..9b0384b 100644 --- a/src/mapping/json/asset/IAssetPalette.ts +++ b/src/mapping/json/asset/IAssetPalette.ts @@ -2,6 +2,10 @@ export interface IAssetPalette { id?: number; source?: string; + master?: boolean; + tags?: string[]; + breed?: number; + colorTag?: number; color1?: string; color2?: string; rgb?: [ number, number, number ][]; diff --git a/src/mapping/json/asset/ISoundSample.ts b/src/mapping/json/asset/ISoundSample.ts index a8c588b..003f9f6 100644 --- a/src/mapping/json/asset/ISoundSample.ts +++ b/src/mapping/json/asset/ISoundSample.ts @@ -1,4 +1,5 @@ -export interface ISoundSample { - id?: number, - noPitch?: boolean +export interface ISoundSample +{ + id?: number; + noPitch?: boolean; } diff --git a/src/mapping/mappers/asset/AssetMapper.ts b/src/mapping/mappers/asset/AssetMapper.ts index 60e04a0..4ebc586 100644 --- a/src/mapping/mappers/asset/AssetMapper.ts +++ b/src/mapping/mappers/asset/AssetMapper.ts @@ -84,6 +84,10 @@ export class AssetMapper extends Mapper if(paletteXML.id !== undefined) palette.id = paletteXML.id; if(paletteXML.source !== undefined) palette.source = paletteXML.source; + if(paletteXML.master !== undefined) palette.master = paletteXML.master; + if(paletteXML.tags !== undefined) palette.tags = paletteXML.tags; + if(paletteXML.breed !== undefined) palette.breed = paletteXML.breed; + if(paletteXML.colorTag !== undefined) palette.colorTag = paletteXML.colorTag; if(paletteXML.color1 !== undefined) palette.color1 = paletteXML.color1; if(paletteXML.color2 !== undefined) palette.color2 = paletteXML.color2; diff --git a/src/mapping/mappers/asset/LogicMapper.ts b/src/mapping/mappers/asset/LogicMapper.ts index 0605323..c0a4ba5 100644 --- a/src/mapping/mappers/asset/LogicMapper.ts +++ b/src/mapping/mappers/asset/LogicMapper.ts @@ -1,7 +1,6 @@ -import {IAssetData} from '../../json'; -import {LogicXML} from '../../xml'; -import {Mapper} from './Mapper'; -import {ISoundSample} from "../../json/asset/ISoundSample"; +import { IAssetData } from '../../json'; +import { LogicXML } from '../../xml'; +import { Mapper } from './Mapper'; export class LogicMapper extends Mapper { diff --git a/src/mapping/xml/asset/assets/PaletteXML.ts b/src/mapping/xml/asset/assets/PaletteXML.ts index 7893a8a..d0bae8d 100644 --- a/src/mapping/xml/asset/assets/PaletteXML.ts +++ b/src/mapping/xml/asset/assets/PaletteXML.ts @@ -2,6 +2,10 @@ export class PaletteXML { private readonly _id: number; private readonly _source: string; + private readonly _master: boolean; + private readonly _tags: string[]; + private readonly _breed: number; + private readonly _colorTag: number; private readonly _color1: string; private readonly _color2: string; @@ -13,6 +17,10 @@ export class PaletteXML { if(attributes.id !== undefined) this._id = parseInt(attributes.id); if(attributes.source !== undefined) this._source = attributes.source; + if(attributes.master !== undefined) this._master = (attributes.master === 'true') ? true : false; + if(attributes.tags !== undefined) this._tags = attributes.tags.split(','); + if(attributes.breed !== undefined) this._breed = parseInt(attributes.breed); + if(attributes.colortag !== undefined) this._colorTag = parseInt(attributes.colortag); if(attributes.color1 !== undefined) this._color1 = attributes.color1; if(attributes.color2 !== undefined) this._color2 = attributes.color2; } @@ -28,6 +36,26 @@ export class PaletteXML return this._source; } + public get master(): boolean + { + return this._master; + } + + public get tags(): string[] + { + return this._tags; + } + + public get breed(): number + { + return this._breed; + } + + public get colorTag(): number + { + return this._colorTag; + } + public get color1(): string { return this._color1; diff --git a/src/mapping/xml/asset/logic/model/DimensionsXML.ts b/src/mapping/xml/asset/logic/model/DimensionsXML.ts index fe01a82..800c8c3 100644 --- a/src/mapping/xml/asset/logic/model/DimensionsXML.ts +++ b/src/mapping/xml/asset/logic/model/DimensionsXML.ts @@ -12,7 +12,7 @@ export class DimensionsXML { if(attributes.x !== undefined) this._x = parseInt(attributes.x); if(attributes.y !== undefined) this._y = parseInt(attributes.y); - if(attributes.z !== undefined) this._z = parseInt(attributes.z); + if(attributes.z !== undefined) this._z = parseFloat(attributes.z); } }