All converters working

This commit is contained in:
Bill 2021-02-19 23:10:06 -05:00
parent 812d0ee74d
commit 66cfa1a32b
64 changed files with 1553 additions and 73 deletions

View File

@ -1,6 +1,7 @@
import 'reflect-metadata';
import { container } from 'tsyringe';
import { Configuration } from './common/config/Configuration';
import { EffectConverter } from './converters/effect/EffectConverter';
import { FigureConverter } from './converters/figure/FigureConverter';
import { FurnitureConverter } from './converters/furniture/FurnitureConverter';
import { PetConverter } from './converters/pet/PetConverter';
@ -28,9 +29,9 @@ import { PetConverter } from './converters/pet/PetConverter';
await petConverter.convertAsync();
}
// if(config.getBoolean('convert.effect'))
// {
// const effectConverter = container.resolve(EffectConverter);
// await effectConverter.convertAsync();
// }
if(config.getBoolean('convert.effect'))
{
const effectConverter = container.resolve(EffectConverter);
await effectConverter.convertAsync();
}
})();

View File

@ -62,7 +62,7 @@ export class BundleProvider
width: 3072,
height: 2048,
fixedSize: false,
allowRotation: true,
allowRotation: false,
detectIdentical: true,
allowTrim: true,
//@ts-ignore

View File

@ -83,6 +83,15 @@ export class SWFConverter
return await parseStringPromise(binaryData.binaryData);
}
protected static async getAnimationXML(habboAssetSWF: HabboAssetSWF): Promise<any>
{
const binaryData = SWFConverter.getBinaryData(habboAssetSWF, 'animation', false);
if(!binaryData) return null;
return await parseStringPromise(binaryData.binaryData);
}
protected static getPalette(habboAssetSWF: HabboAssetSWF, paletteName: string): [ number, number, number ][]
{
const binaryData = SWFConverter.getBinaryData(habboAssetSWF, paletteName, false);

View File

@ -12,7 +12,7 @@
"dynamic.download.url.effect": "/gordon/PRODUCTION/%className%.swf",
"dynamic.download.url.pet": "/gordon/PRODUCTION/%className%.swf",
"convert.furniture": "1",
"convert.figure": "0",
"convert.effect": "0",
"convert.figure": "1",
"convert.effect": "1",
"convert.pet": "1"
}

View File

@ -0,0 +1,77 @@
import * as ora from 'ora';
import { singleton } from 'tsyringe';
import { BundleProvider } from '../../common/bundle/BundleProvider';
import { Configuration } from '../../common/config/Configuration';
import { SWFConverter } from '../../common/converters/SWFConverter';
import { IAssetData } from '../../mapping/json';
import { AnimationMapper, ManifestMapper } from '../../mapping/mappers';
import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
import File from '../../utils/File';
import Logger from '../../utils/Logger';
import { EffectDownloader } from './EffectDownloader';
@singleton()
export class EffectConverter extends SWFConverter
{
constructor(
private readonly _effectDownloader: EffectDownloader,
private readonly _configuration: Configuration,
private readonly _bundleProvider: BundleProvider,
private readonly _logger: Logger)
{
super();
}
public async convertAsync(): Promise<void>
{
const now = Date.now();
const spinner = ora('Preparing Effects').start();
const outputFolder = new File(this._configuration.getValue('output.folder.effect'));
if(!outputFolder.isDirectory()) outputFolder.mkdirs();
try
{
await this._effectDownloader.download(async (habboAssetSwf: HabboAssetSWF, className: string) =>
{
spinner.text = 'Parsing Effect: ' + habboAssetSwf.getDocumentClass();
spinner.render();
const spriteBundle = await this._bundleProvider.generateSpriteSheet(habboAssetSwf);
const assetData = await this.mapXML2JSON(habboAssetSwf, className);
await this.fromHabboAsset(habboAssetSwf, outputFolder.path, assetData.type, assetData, spriteBundle);
});
spinner.succeed(`Effects finished in ${ Date.now() - now }ms`);
}
catch (error)
{
spinner.fail('Effects failed: ' + error.message);
}
}
private async mapXML2JSON(habboAssetSWF: HabboAssetSWF, assetType: string): Promise<IAssetData>
{
if(!habboAssetSWF) return null;
const assetData: IAssetData = {};
assetData.name = assetType;
assetData.type = EffectDownloader.EFFECT_TYPES.get(assetType);
const manifestXML = await EffectConverter.getManifestXML(habboAssetSWF);
if(manifestXML) ManifestMapper.mapXML(manifestXML, assetData);
const animationXML = await EffectConverter.getAnimationXML(habboAssetSWF);
if(animationXML) AnimationMapper.mapXML(animationXML, assetData);
return assetData;
}
}

View File

@ -0,0 +1,77 @@
import { singleton } from 'tsyringe';
import { Configuration } from '../../common/config/Configuration';
import { IEffectMap } from '../../mapping/json';
import { HabboAssetSWF } from '../../swf/HabboAssetSWF';
import { FileUtilities } from '../../utils/FileUtilities';
@singleton()
export class EffectDownloader
{
public static EFFECT_TYPES: Map<string, string> = new Map();
constructor(private readonly _configuration: Configuration)
{}
public async download(callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
{
const effectMap = await this.parseEffectMap();
const classNames: string[] = [];
if(effectMap.effects !== undefined)
{
for(const library of effectMap.effects)
{
const className = library.lib;
if(classNames.indexOf(className) >= 0) continue;
classNames.push(className);
try
{
EffectDownloader.EFFECT_TYPES.set(className, library.type);
await this.extractEffect(className, callback);
}
catch (error)
{
console.log();
console.error(`Error parsing ${ className }: ` + error.message);
}
}
}
}
public async parseEffectMap(): Promise<IEffectMap>
{
const url = this._configuration.getValue('effectmap.url');
if(!url || !url.length) return null;
const content = await FileUtilities.readFileAsString(url);
if(!content || !content.length) return null;
return (JSON.parse(content) as IEffectMap);
}
public async extractEffect(className: string, callback: (habboAssetSwf: HabboAssetSWF, className: string) => Promise<void>): Promise<void>
{
let url = this._configuration.getValue('dynamic.download.url.effect');
if(!url || !url.length) return;
url = url.replace('%className%', className);
const buffer = await FileUtilities.readFileAsBuffer(url);
if(!buffer) return;
const newHabboAssetSWF = new HabboAssetSWF(buffer);
await newHabboAssetSWF.setupAsync();
await callback(newHabboAssetSWF, className);
}
}

View File

@ -1,6 +1,6 @@
export interface IAssetAlias
{
link: string;
fliph: number;
flipv: number;
}
link?: string;
flipH?: boolean;
flipV?: boolean;
}

View File

@ -1,3 +1,4 @@
import { IAssetAnimation } from './animation';
import { IAsset } from './IAsset';
import { IAssetAlias } from './IAssetAlias';
import { IAssetDimension } from './IAssetDimension';
@ -18,6 +19,7 @@ export interface IAssetData {
directions?: number[];
assets?: { [index: string]: IAsset };
aliases?: { [index: string]: IAssetAlias };
animations?: { [index: string]: IAssetAnimation };
palettes?: { [index: string]: IAssetPalette };
visualizations?: IAssetVisualizationData[];
}

View File

@ -0,0 +1,23 @@
import { IAssetAnimationAdd } from './IAssetAnimationAdd';
import { IAssetAnimationAvatar } from './IAssetAnimationAvatar';
import { IAssetAnimationDirection } from './IAssetAnimationDirection';
import { IAssetAnimationFrame } from './IAssetAnimationFrame';
import { IAssetAnimationOverride } from './IAssetAnimationOverride';
import { IAssetAnimationRemove } from './IAssetAnimationRemove';
import { IAssetAnimationShadow } from './IAssetAnimationShadow';
import { IAssetAnimationSprite } from './IAssetAnimationSprite';
export interface IAssetAnimation
{
name?: string;
desc?: string;
resetOnToggle?: boolean;
directions?: IAssetAnimationDirection[];
shadows?: IAssetAnimationShadow[];
adds?: IAssetAnimationAdd[];
removes?: IAssetAnimationRemove[];
sprites?: IAssetAnimationSprite[];
frames?: IAssetAnimationFrame[];
avatars?: IAssetAnimationAvatar[];
overrides?: IAssetAnimationOverride[];
}

View File

@ -0,0 +1,8 @@
export interface IAssetAnimationAdd
{
id?: string;
align?: string;
blend?: string;
ink?: number;
base?: string;
}

View File

@ -0,0 +1,6 @@
export interface IAssetAnimationAvatar
{
ink?: number;
foreground?: string;
background?: string;
}

View File

@ -0,0 +1,4 @@
export interface IAssetAnimationDirection
{
offset?: number;
}

View File

@ -0,0 +1,8 @@
import { IAssetAnimationFramePart } from './IAssetAnimationFramePart';
export interface IAssetAnimationFrame
{
repeats?: number;
fxs?: IAssetAnimationFramePart[];
bodyparts?: IAssetAnimationFramePart[];
}

View File

@ -0,0 +1,14 @@
import { IAssetAnimationFramePartItem } from './IAssetAnimationFramePartItem';
export interface IAssetAnimationFramePart
{
id?: string;
frame?: number;
base?: string;
action?: string;
dx?: number;
dy?: number;
dz?: number;
dd?: number;
items?: IAssetAnimationFramePartItem[];
}

View File

@ -0,0 +1,5 @@
export interface IAssetAnimationFramePartItem
{
id?: string;
base?: string;
}

View File

@ -0,0 +1,8 @@
import { IAssetAnimationFrame } from './IAssetAnimationFrame';
export interface IAssetAnimationOverride
{
name?: string;
override?: string;
frames?: IAssetAnimationFrame[];
}

View File

@ -0,0 +1,4 @@
export interface IAssetAnimationRemove
{
id?: string;
}

View File

@ -0,0 +1,4 @@
export interface IAssetAnimationShadow
{
id?: string;
}

View File

@ -0,0 +1,11 @@
import { IAssetAnimationSpriteDirection } from './IAssetAnimationSpriteDirection';
export interface IAssetAnimationSprite
{
id?: string;
member?: string;
directions?: number;
staticY?: number;
ink?: number;
directionList?: IAssetAnimationSpriteDirection[];
}

View File

@ -0,0 +1,7 @@
export interface IAssetAnimationSpriteDirection
{
id?: number;
dx?: number;
dy?: number;
dz?: number;
}

View File

@ -0,0 +1,12 @@
export * from './IAssetAnimation';
export * from './IAssetAnimationAdd';
export * from './IAssetAnimationAvatar';
export * from './IAssetAnimationDirection';
export * from './IAssetAnimationFrame';
export * from './IAssetAnimationFramePart';
export * from './IAssetAnimationFramePartItem';
export * from './IAssetAnimationOverride';
export * from './IAssetAnimationRemove';
export * from './IAssetAnimationShadow';
export * from './IAssetAnimationSprite';
export * from './IAssetAnimationSpriteDirection';

View File

@ -1,3 +1,4 @@
export * from './animation';
export * from './IAsset';
export * from './IAssetAlias';
export * from './IAssetData';

View File

@ -1,4 +1,4 @@
import { IAssetAnimation } from './animation/IAssetAnimation';
import { IAssetVisualAnimation } from './animation/IAssetVisualAnimation';
import { IAssetColor } from './color/IAssetColor';
import { IAssetGesture } from './gestures/IAssetGesture';
import { IAssetVisualizationDirection } from './IAssetVisualizationDirection';
@ -13,7 +13,7 @@ export interface IAssetVisualizationData
layers?: { [index: string]: IAssetVisualizationLayer };
colors?: { [index: string]: IAssetColor };
directions?: { [index: string]: IAssetVisualizationDirection };
animations?: { [index: string]: IAssetAnimation };
animations?: { [index: string]: IAssetVisualAnimation };
postures?: { [index: string]: IAssetPosture };
gestures?: { [index: string]: IAssetGesture };
}

View File

@ -1,9 +0,0 @@
import { IAssetAnimationLayer } from './IAssetAnimationLayer';
export interface IAssetAnimation
{
transitionTo?: number;
transitionFrom?: number;
immediateChangeFrom?: string;
layers?: { [index: string]: IAssetAnimationLayer };
}

View File

@ -1,9 +0,0 @@
import { IAssetAnimationSequence } from './IAssetAnimationSequence';
export interface IAssetAnimationLayer
{
loopCount?: number;
frameRepeat?: number;
random?: number;
frameSequences?: { [index: string]: IAssetAnimationSequence };
}

View File

@ -1,8 +0,0 @@
import { IAssetAnimationSequenceFrame } from './IAssetAnimationSequenceFrame';
export interface IAssetAnimationSequence
{
loopCount?: number;
random?: number;
frames?: { [index: string]: IAssetAnimationSequenceFrame };
}

View File

@ -1,11 +0,0 @@
import { IAssetAnimationSequenceFrameOffset } from './IAssetAnimationSequenceFrameOffset';
export interface IAssetAnimationSequenceFrame
{
id?: number;
x?: number;
y?: number;
randomX?: number;
randomY?: number;
offsets?: { [index: string]: IAssetAnimationSequenceFrameOffset };
}

View File

@ -0,0 +1,10 @@
import { IAssetVisualAnimationLayer } from './IAssetVisualAnimationLayer';
export interface IAssetVisualAnimation
{
transitionTo?: number;
transitionFrom?: number;
immediateChangeFrom?: string;
randomStart?: boolean;
layers?: { [index: string]: IAssetVisualAnimationLayer };
}

View File

@ -0,0 +1,9 @@
import { IAssetVisualAnimationSequence } from './IAssetVisualAnimationSequence';
export interface IAssetVisualAnimationLayer
{
loopCount?: number;
frameRepeat?: number;
random?: number;
frameSequences?: { [index: string]: IAssetVisualAnimationSequence };
}

View File

@ -0,0 +1,8 @@
import { IAssetVisualAnimationSequenceFrame } from './IAssetVisualAnimationSequenceFrame';
export interface IAssetVisualAnimationSequence
{
loopCount?: number;
random?: number;
frames?: { [index: string]: IAssetVisualAnimationSequenceFrame };
}

View File

@ -0,0 +1,11 @@
import { IAssetVisualAnimationSequenceFrameOffset } from './IAssetVisualAnimationSequenceFrameOffset';
export interface IAssetVisualAnimationSequenceFrame
{
id?: number;
x?: number;
y?: number;
randomX?: number;
randomY?: number;
offsets?: { [index: string]: IAssetVisualAnimationSequenceFrameOffset };
}

View File

@ -1,4 +1,4 @@
export interface IAssetAnimationSequenceFrameOffset
export interface IAssetVisualAnimationSequenceFrameOffset
{
direction?: number;
x?: number;

View File

@ -1,5 +1,5 @@
export * from './IAssetAnimation';
export * from './IAssetAnimationLayer';
export * from './IAssetAnimationSequence';
export * from './IAssetAnimationSequenceFrame';
export * from './IAssetAnimationSequenceFrameOffset';
export * from './IAssetVisualAnimation';
export * from './IAssetVisualAnimationLayer';
export * from './IAssetVisualAnimationSequence';
export * from './IAssetVisualAnimationSequenceFrame';
export * from './IAssetVisualAnimationSequenceFrameOffset';

View File

@ -0,0 +1,6 @@
import { IEffectMapLibrary } from './IEffectMapLibrary';
export interface IEffectMap
{
effects: IEffectMapLibrary[];
}

View File

@ -0,0 +1,7 @@
export interface IEffectMapLibrary
{
id: string;
lib: string;
type: string;
revision: number;
}

View File

@ -0,0 +1,2 @@
export * from './IEffectMap';
export * from './IEffectMapLibrary';

View File

@ -1,3 +1,4 @@
export * from './asset';
export * from './effectmap';
export * from './figuremap';
export * from './furnidata';

View File

@ -0,0 +1,328 @@
import { IAssetAnimation, IAssetAnimationAdd, IAssetAnimationAvatar, IAssetAnimationDirection, IAssetAnimationFrame, IAssetAnimationFramePart, IAssetAnimationFramePartItem, IAssetAnimationOverride, IAssetAnimationRemove, IAssetAnimationShadow, IAssetAnimationSprite, IAssetAnimationSpriteDirection, IAssetData } from '../../json';
import { AddXML, AvatarXML, DirectionOffsetXML, EffectAnimationXML, EffectFramePartItemXML, EffectFramePartXML, EffectFrameXML, OverrideXML, RemoveXML, ShadowXML, SpriteXML } from '../../xml';
import { Mapper } from './Mapper';
export class AnimationMapper extends Mapper
{
public static mapXML(animation: any, output: IAssetData): void
{
if(!animation || !output) return;
if(animation.animation !== undefined)
{
output.animations = {};
AnimationMapper.mapAnimationXML(new EffectAnimationXML(animation.animation), output.animations);
}
}
private static mapAnimationXML(xml: EffectAnimationXML, output: { [index: string]: IAssetAnimation }): void
{
if(!xml || !output) return;
const animation: IAssetAnimation = {};
if(xml.name !== undefined) animation.name = xml.name;
if(xml.desc !== undefined) animation.desc = xml.desc;
if(xml.resetOnToggle !== undefined) animation.resetOnToggle = xml.resetOnToggle;
if(xml.directions !== undefined)
{
if(xml.directions.length)
{
animation.directions = [];
AnimationMapper.mapAnimationDirectionsXML(xml.directions, animation.directions);
}
}
if(xml.shadows !== undefined)
{
if(xml.shadows.length)
{
animation.shadows = [];
AnimationMapper.mapAnimationShadowsXML(xml.shadows, animation.shadows);
}
}
if(xml.adds !== undefined)
{
if(xml.adds.length)
{
animation.adds = [];
AnimationMapper.mapAnimationAddsXML(xml.adds, animation.adds);
}
}
if(xml.removes !== undefined)
{
if(xml.removes.length)
{
animation.removes = [];
AnimationMapper.mapAnimationRemovesXML(xml.removes, animation.removes);
}
}
if(xml.sprites !== undefined)
{
if(xml.sprites.length)
{
animation.sprites = [];
AnimationMapper.mapAnimationSpritesXML(xml.sprites, animation.sprites);
}
}
if(xml.frames !== undefined)
{
if(xml.frames.length)
{
animation.frames = [];
AnimationMapper.mapAnimationFramesXML(xml.frames, animation.frames);
}
}
if(xml.avatars !== undefined)
{
if(xml.avatars.length)
{
animation.avatars = [];
AnimationMapper.mapAnimationAvatarsXML(xml.avatars, animation.avatars);
}
}
if(xml.overrides !== undefined)
{
if(xml.overrides.length)
{
animation.overrides = [];
AnimationMapper.mapAnimationOverridesXML(xml.overrides, animation.overrides);
}
}
output[xml.desc] = animation;
}
private static mapAnimationDirectionsXML(xml: DirectionOffsetXML[], output: IAssetAnimationDirection[]): void
{
if(!xml || !xml.length || !output) return;
for(const offsetXML of xml)
{
const direction: IAssetAnimationDirection = {};
if(offsetXML.offset !== undefined) direction.offset = offsetXML.offset;
output.push(direction);
}
}
private static mapAnimationShadowsXML(xml: ShadowXML[], output: IAssetAnimationShadow[]): void
{
if(!xml || !xml.length || !output) return;
for(const shadowXML of xml)
{
const shadow: IAssetAnimationShadow = {};
if(shadowXML.id !== undefined) shadow.id = shadowXML.id;
output.push(shadow);
}
}
private static mapAnimationAddsXML(xml: AddXML[], output: IAssetAnimationAdd[]): void
{
if(!xml || !xml.length || !output) return;
for(const addXML of xml)
{
const add: IAssetAnimationAdd = {};
if(addXML.id !== undefined) add.id = addXML.id;
if(addXML.align !== undefined) add.align = addXML.align;
if(addXML.blend !== undefined) add.blend = addXML.blend;
if(addXML.ink !== undefined) add.ink = addXML.ink;
if(addXML.base !== undefined) add.base = addXML.base;
output.push(add);
}
}
private static mapAnimationRemovesXML(xml: RemoveXML[], output: IAssetAnimationRemove[]): void
{
if(!xml || !xml.length || !output) return;
for(const removeXML of xml)
{
const remove: IAssetAnimationRemove = {};
if(removeXML.id !== undefined) remove.id = removeXML.id;
output.push(remove);
}
}
private static mapAnimationSpritesXML(xml: SpriteXML[], output: IAssetAnimationSprite[]): void
{
if(!xml || !xml.length || !output) return;
for(const spriteXML of xml)
{
const sprite: IAssetAnimationSprite = {};
if(spriteXML.id !== undefined) sprite.id = spriteXML.id;
if(spriteXML.directions !== undefined) sprite.directions = spriteXML.directions;
if(spriteXML.member !== undefined) sprite.member = spriteXML.member;
if(spriteXML.ink !== undefined) sprite.ink = spriteXML.ink;
if(spriteXML.staticY !== undefined) sprite.staticY = spriteXML.staticY;
if(spriteXML.directionList !== undefined)
{
if(spriteXML.directionList.length)
{
sprite.directionList = [];
for(const directionXML of spriteXML.directionList)
{
const direction: IAssetAnimationSpriteDirection = {};
if(directionXML.id !== undefined) direction.id = directionXML.id;
if(directionXML.dx !== undefined) direction.dx = directionXML.dx;
if(directionXML.dy !== undefined) direction.dy = directionXML.dy;
if(directionXML.dz !== undefined) direction.dz = directionXML.dz;
sprite.directionList.push(direction);
}
}
}
output.push(sprite);
}
}
private static mapAnimationFramesXML(xml: EffectFrameXML[], output: IAssetAnimationFrame[]): void
{
if(!xml || !xml.length || !output) return;
for(const frameXML of xml)
{
const frame: IAssetAnimationFrame = {};
if(frameXML.fxs !== undefined)
{
if(frameXML.fxs.length)
{
frame.fxs = [];
AnimationMapper.mapAnimationFramesPartXML(frameXML.fxs, frame.fxs);
}
}
if(frameXML.bodyParts !== undefined)
{
if(frameXML.bodyParts.length)
{
frame.bodyparts = [];
AnimationMapper.mapAnimationFramesPartXML(frameXML.bodyParts, frame.bodyparts);
}
}
output.push(frame);
}
}
private static mapAnimationFramesPartXML(xml: EffectFramePartXML[], output: IAssetAnimationFramePart[]): void
{
if(!xml || !xml.length || !output) return;
for(const framePartXML of xml)
{
const framePart: IAssetAnimationFramePart = {};
if(framePartXML.id !== undefined) framePart.id = framePartXML.id;
if(framePartXML.frame !== undefined) framePart.frame = framePartXML.frame;
if(framePartXML.base !== undefined) framePart.base = framePartXML.base;
if(framePartXML.action !== undefined) framePart.action = framePartXML.action;
if(framePartXML.dx !== undefined) framePart.dx = framePartXML.dx;
if(framePartXML.dy !== undefined) framePart.dy = framePartXML.dy;
if(framePartXML.dz !== undefined) framePart.dz = framePartXML.dz;
if(framePartXML.dd !== undefined) framePart.dd = framePartXML.dd;
if(framePartXML.items !== undefined)
{
if(framePartXML.items.length)
{
framePart.items = [];
AnimationMapper.mapAnimationFramesPartItemXML(framePartXML.items, framePart.items);
}
}
output.push(framePart);
}
}
private static mapAnimationFramesPartItemXML(xml: EffectFramePartItemXML[], output: IAssetAnimationFramePartItem[]): void
{
if(!xml || !xml.length || !output) return;
for(const framePartItemXML of xml)
{
const item: IAssetAnimationFramePartItem = {};
if(framePartItemXML.id !== undefined) item.id = framePartItemXML.id;
if(framePartItemXML.base !== undefined) item.base = framePartItemXML.base;
output.push(item);
}
}
private static mapAnimationAvatarsXML(xml: AvatarXML[], output: IAssetAnimationAvatar[]): void
{
if(!xml || !xml.length || !output) return;
for(const avatarXML of xml)
{
const avatar: IAssetAnimationAvatar = {};
if(avatarXML.background !== undefined) avatar.background = avatarXML.background;
if(avatarXML.foreground !== undefined) avatar.foreground = avatarXML.foreground;
if(avatarXML.ink !== undefined) avatar.ink = avatarXML.ink;
output.push(avatar);
}
}
private static mapAnimationOverridesXML(xml: OverrideXML[], output: IAssetAnimationOverride[]): void
{
if(!xml || !xml.length || !output) return;
for(const overrideXML of xml)
{
const override: IAssetAnimationOverride = {};
if(overrideXML.name !== undefined) override.name = overrideXML.name;
if(overrideXML.override !== undefined) override.override = overrideXML.override;
if(overrideXML.frames !== undefined)
{
if(overrideXML.frames.length)
{
override.frames = [];
AnimationMapper.mapAnimationFramesXML(overrideXML.frames, override.frames);
}
}
output.push(override);
}
}
}

View File

@ -1,6 +1,6 @@
import { BundleProvider } from '../../../common/bundle/BundleProvider';
import { IAsset, IAssetData } from '../../json';
import { ManifestLibraryAssetParamXML, ManifestLibraryAssetXML, ManifestLibraryXML, ManifestXML } from '../../xml';
import { IAsset, IAssetAlias, IAssetData } from '../../json';
import { ManifestLibraryAliasXML, ManifestLibraryAssetParamXML, ManifestLibraryAssetXML, ManifestLibraryXML, ManifestXML } from '../../xml';
import { Mapper } from './Mapper';
export class ManifestMapper extends Mapper
@ -32,6 +32,16 @@ export class ManifestMapper extends Mapper
ManifestMapper.mapManifestLibraryAssetXML(xml.assets, output.assets);
}
}
if(xml.aliases !== undefined)
{
if(xml.aliases.length)
{
output.aliases = {};
ManifestMapper.mapManifestLibraryAliasXML(xml.aliases, output.aliases);
}
}
}
private static mapManifestLibraryAssetXML(xml: ManifestLibraryAssetXML[], output: { [index: string]: IAsset }): void
@ -69,4 +79,31 @@ export class ManifestMapper extends Mapper
output.y = parseInt(split[1]);
}
}
private static mapManifestLibraryAliasXML(xml: ManifestLibraryAliasXML[], output: { [index: string]: IAssetAlias }): void
{
if(!xml || !xml.length || !output) return;
for(const libraryAliasXML of xml)
{
const alias: IAssetAlias = {};
if(libraryAliasXML.name !== undefined)
{
if(libraryAliasXML.link !== undefined)
{
if(libraryAliasXML.link.startsWith('sh_')) continue;
if(libraryAliasXML.link.indexOf('_32_') >= 0) continue;
alias.link = libraryAliasXML.link;
}
if(libraryAliasXML.flipH !== undefined) alias.flipH = libraryAliasXML.flipH;
if(libraryAliasXML.flipH !== undefined) alias.flipV = libraryAliasXML.flipV;
output[libraryAliasXML.name] = alias;
}
}
}
}

View File

@ -1,4 +1,4 @@
import { IAssetAnimation, IAssetAnimationLayer, IAssetAnimationSequence, IAssetAnimationSequenceFrame, IAssetAnimationSequenceFrameOffset, IAssetColor, IAssetColorLayer, IAssetData, IAssetGesture, IAssetPosture, IAssetVisualizationData, IAssetVisualizationDirection, IAssetVisualizationLayer } from '../../json';
import { IAssetColor, IAssetColorLayer, IAssetData, IAssetGesture, IAssetPosture, IAssetVisualAnimation, IAssetVisualAnimationLayer, IAssetVisualAnimationSequence, IAssetVisualAnimationSequenceFrame, IAssetVisualAnimationSequenceFrameOffset, IAssetVisualizationData, IAssetVisualizationDirection, IAssetVisualizationLayer } from '../../json';
import { AnimationLayerXML, AnimationXML, ColorLayerXML, ColorXML, FrameOffsetXML, FrameSequenceXML, FrameXML, GestureXML, LayerXML, PostureXML, VisualDirectionXML, VisualizationDataXML, VisualizationXML } from '../../xml';
import { Mapper } from './Mapper';
@ -185,17 +185,18 @@ export class VisualizationMapper extends Mapper
}
}
private static mapVisualizationAnimationXML(xml: AnimationXML[], output: { [index: string]: IAssetAnimation }): void
private static mapVisualizationAnimationXML(xml: AnimationXML[], output: { [index: string]: IAssetVisualAnimation }): void
{
if(!xml || !xml.length || !output) return;
for(const animationXML of xml)
{
const animation: IAssetAnimation = {};
const animation: IAssetVisualAnimation = {};
if(animationXML.transitionTo !== undefined) animation.transitionTo = animationXML.transitionTo;
if(animationXML.transitionFrom !== undefined) animation.transitionFrom = animationXML.transitionFrom;
if(animationXML.immediateChangeFrom !== undefined) animation.immediateChangeFrom = animationXML.immediateChangeFrom;
if(animationXML.randomStart !== undefined) animation.randomStart = animationXML.randomStart;
if(animationXML.layers !== undefined)
{
@ -211,13 +212,13 @@ export class VisualizationMapper extends Mapper
}
}
private static mapVisualizationAnimationLayerXML(xml: AnimationLayerXML[], output: { [index: string]: IAssetAnimationLayer }): void
private static mapVisualizationAnimationLayerXML(xml: AnimationLayerXML[], output: { [index: string]: IAssetVisualAnimationLayer }): void
{
if(!xml || !xml.length || !output) return;
for(const animationLayerXML of xml)
{
const animationLayer: IAssetAnimationLayer = {};
const animationLayer: IAssetVisualAnimationLayer = {};
if(animationLayerXML.frameRepeat !== undefined) animationLayer.frameRepeat = animationLayerXML.frameRepeat;
if(animationLayerXML.loopCount !== undefined) animationLayer.loopCount = animationLayerXML.loopCount;
@ -237,7 +238,7 @@ export class VisualizationMapper extends Mapper
}
}
private static mapVisualizationFrameSequenceXML(xml: FrameSequenceXML[], output: { [index: string]: IAssetAnimationSequence }): void
private static mapVisualizationFrameSequenceXML(xml: FrameSequenceXML[], output: { [index: string]: IAssetVisualAnimationSequence }): void
{
if(!xml || !xml.length || !output) return;
@ -245,7 +246,7 @@ export class VisualizationMapper extends Mapper
for(const frameSequenceXML of xml)
{
const frameSequence: IAssetAnimationSequence = {};
const frameSequence: IAssetVisualAnimationSequence = {};
if(frameSequenceXML.loopCount !== undefined) frameSequence.loopCount = frameSequenceXML.loopCount;
if(frameSequenceXML.random !== undefined) frameSequence.random = frameSequenceXML.random;
@ -266,7 +267,7 @@ export class VisualizationMapper extends Mapper
}
}
private static mapVisualizationFrameSequenceFrameXML(xml: FrameXML[], output: { [index: string]: IAssetAnimationSequenceFrame }): void
private static mapVisualizationFrameSequenceFrameXML(xml: FrameXML[], output: { [index: string]: IAssetVisualAnimationSequenceFrame }): void
{
if(!xml || !xml.length || !output) return;
@ -274,7 +275,7 @@ export class VisualizationMapper extends Mapper
for(const frameXML of xml)
{
const frame: IAssetAnimationSequenceFrame = {};
const frame: IAssetVisualAnimationSequenceFrame = {};
if((frameXML.id === undefined) || (frameXML.id === 'NaN')) frame.id = 0;
else frame.id = parseInt(frameXML.id);
@ -300,7 +301,7 @@ export class VisualizationMapper extends Mapper
}
}
private static mapVisualizationFrameSequenceFrameOffsetXML(xml: FrameOffsetXML[], output: { [index: string]: IAssetAnimationSequenceFrameOffset }): void
private static mapVisualizationFrameSequenceFrameOffsetXML(xml: FrameOffsetXML[], output: { [index: string]: IAssetVisualAnimationSequenceFrameOffset }): void
{
if(!xml || !xml.length || !output) return;
@ -308,7 +309,7 @@ export class VisualizationMapper extends Mapper
for(const offsetXML of xml)
{
const offset: IAssetAnimationSequenceFrameOffset = {};
const offset: IAssetVisualAnimationSequenceFrameOffset = {};
if(offsetXML.direction !== undefined) offset.direction = offsetXML.direction;
if(offsetXML.x !== undefined) offset.x = offsetXML.x;

View File

@ -1,3 +1,4 @@
export * from './AnimationMapper';
export * from './AssetMapper';
export * from './IndexMapper';
export * from './LogicMapper';

View File

@ -0,0 +1,47 @@
export class AddXML
{
private readonly _id: string;
private readonly _align: string;
private readonly _blend: string;
private readonly _ink: number;
private readonly _base: string;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.id !== undefined) this._id = attributes.id;
if(attributes.align !== undefined) this._align = attributes.align;
if(attributes.blend !== undefined) this._blend = attributes.blend;
if(attributes.ink !== undefined) this._ink = parseInt(attributes.ink);
if(attributes.base !== undefined) this._base = attributes.base;
}
}
public get id(): string
{
return this._id;
}
public get align(): string
{
return this._align;
}
public get blend(): string
{
return this._blend;
}
public get ink(): number
{
return this._ink;
}
public get base(): string
{
return this._base;
}
}

View File

@ -0,0 +1,33 @@
export class AvatarXML
{
private readonly _ink: number;
private readonly _foreground: string;
private readonly _background: string;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.ink !== undefined) this._ink = parseInt(attributes.ink);
if(attributes.foreground !== undefined) this._foreground = attributes.foreground;
if(attributes.background !== undefined) this._background = attributes.background;
}
}
public get ink(): number
{
return this._ink;
}
public get foreground(): string
{
return this._foreground;
}
public get background(): string
{
return this._background;
}
}

View File

@ -0,0 +1,19 @@
export class DirectionOffsetXML
{
private readonly _offset: number;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.offset !== undefined) this._offset = parseInt(attributes.offset);
}
}
public get offset(): number
{
return this._offset;
}
}

View File

@ -0,0 +1,40 @@
export class DirectionXML
{
private readonly _id: number;
private readonly _dx: number;
private readonly _dy: number;
private readonly _dz: number;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.id !== undefined) this._id = parseInt(attributes.id);
if(attributes.dx !== undefined) this._dx = parseInt(attributes.dx);
if(attributes.dy !== undefined) this._dy = parseInt(attributes.dy);
if(attributes.dz !== undefined) this._dz = parseInt(attributes.dz);
}
}
public get id(): number
{
return this._id;
}
public get dx(): number
{
return this._dx;
}
public get dy(): number
{
return this._dy;
}
public get dz(): number
{
return this._dz;
}
}

View File

@ -0,0 +1,171 @@
import { AddXML } from './AddXML';
import { AvatarXML } from './AvatarXML';
import { DirectionOffsetXML } from './DirectionOffsetXML';
import { EffectFrameXML } from './EffectFrameXML';
import { OverrideXML } from './OverrideXML';
import { RemoveXML } from './RemoveXML';
import { ShadowXML } from './ShadowXML';
import { SpriteXML } from './SpriteXML';
export class EffectAnimationXML
{
private readonly _name: string;
private readonly _desc: string;
private readonly _resetOnToggle: boolean;
private readonly _directions: DirectionOffsetXML[];
private readonly _shadows: ShadowXML[];
private readonly _adds: AddXML[];
private readonly _removes: RemoveXML[];
private readonly _sprites: SpriteXML[];
private readonly _frames: EffectFrameXML[];
private readonly _avatars: AvatarXML[];
private readonly _overrides: OverrideXML[];
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.name !== undefined) this._name = attributes.name;
if(attributes.desc !== undefined) this._desc = attributes.desc;
if(attributes.resetOnToggle !== undefined) this._resetOnToggle = (attributes.resetOnToggle === '1');
}
if(xml.direction !== undefined)
{
if(Array.isArray(xml.direction))
{
this._directions = [];
for(const direction of xml.direction) this._directions.push(new DirectionOffsetXML(direction));
}
}
if(xml.shadow !== undefined)
{
if(Array.isArray(xml.shadow))
{
this._shadows = [];
for(const shadow of xml.shadow) this._shadows.push(new ShadowXML(shadow));
}
}
if(xml.add !== undefined)
{
if(Array.isArray(xml.add))
{
this._adds = [];
for(const add of xml.add) this._adds.push(new AddXML(add));
}
}
if(xml.remove !== undefined)
{
if(Array.isArray(xml.remove))
{
this._removes = [];
for(const remove of xml.remove) this._removes.push(new RemoveXML(remove));
}
}
if(xml.sprite !== undefined)
{
if(Array.isArray(xml.sprite))
{
this._sprites = [];
for(const sprite of xml.sprite) this._sprites.push(new SpriteXML(sprite));
}
}
if(xml.frame !== undefined)
{
if(Array.isArray(xml.frame))
{
this._frames = [];
for(const frame of xml.frame) this._frames.push(new EffectFrameXML(frame));
}
}
if(xml.avatar !== undefined)
{
if(Array.isArray(xml.avatar))
{
this._avatars = [];
for(const avatar of xml.avatar) this._avatars.push(new AvatarXML(avatar));
}
}
if(xml.override !== undefined)
{
if(Array.isArray(xml.override))
{
this._overrides = [];
for(const override of xml.override) this._overrides.push(new OverrideXML(override));
}
}
}
public get name(): string
{
return this._name;
}
public get desc(): string
{
return this._desc;
}
public get resetOnToggle(): boolean
{
return this._resetOnToggle;
}
public get directions(): DirectionOffsetXML[]
{
return this._directions;
}
public get shadows(): ShadowXML[]
{
return this._shadows;
}
public get adds(): AddXML[]
{
return this._adds;
}
public get removes(): RemoveXML[]
{
return this._removes;
}
public get sprites(): SpriteXML[]
{
return this._sprites;
}
public get frames(): EffectFrameXML[]
{
return this._frames;
}
public get avatars(): AvatarXML[]
{
return this._avatars;
}
public get overrides(): OverrideXML[]
{
return this._overrides;
}
}

View File

@ -0,0 +1,26 @@
export class EffectFramePartItemXML
{
private readonly _id: string;
private readonly _base: string;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.id !== undefined) this._id = attributes.id;
if(attributes.base !== undefined) this._base = attributes.base;
}
}
public get id(): string
{
return this._id;
}
public get base(): string
{
return this._base;
}
}

View File

@ -0,0 +1,87 @@
import { EffectFramePartItemXML } from './EffectFramePartItemXML';
export class EffectFramePartXML
{
private readonly _id: string;
private readonly _frame: number;
private readonly _base: string;
private readonly _action: string;
private readonly _dx: number;
private readonly _dy: number;
private readonly _dz: number;
private readonly _dd: number;
private readonly _items: EffectFramePartItemXML[];
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.id !== undefined) this._id = attributes.id;
if(attributes.frame !== undefined) this._frame = parseInt(attributes.frame);
if(attributes.base !== undefined) this._base = attributes.base;
if(attributes.action !== undefined) this._action = attributes.action;
if(attributes.dx !== undefined) this._dx = parseInt(attributes.dx);
if(attributes.dy !== undefined) this._dy = parseInt(attributes.dy);
if(attributes.dz !== undefined) this._dz = parseInt(attributes.dz);
if(attributes.dd !== undefined) this._dd = parseInt(attributes.dd);
}
if(xml.item !== undefined)
{
if(Array.isArray(xml.item))
{
this._items = [];
for(const item of xml.item) this._items.push(new EffectFramePartItemXML(item));
}
}
}
public get id(): string
{
return this._id;
}
public get frame(): number
{
return this._frame;
}
public get base(): string
{
return this._base;
}
public get action(): string
{
return this._action;
}
public get dx(): number
{
return this._dx;
}
public get dy(): number
{
return this._dy;
}
public get dz(): number
{
return this._dz;
}
public get dd(): number
{
return this._dd;
}
public get items(): EffectFramePartItemXML[]
{
return this._items;
}
}

View File

@ -0,0 +1,53 @@
import { EffectFramePartXML } from './EffectFramePartXML';
export class EffectFrameXML
{
private readonly _repeats: number;
private readonly _fxs: EffectFramePartXML[]
private readonly _bodyParts: EffectFramePartXML[];
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.repeats !== undefined) this._repeats = parseInt(attributes.repeats);
}
if(xml.fx !== undefined)
{
if(Array.isArray(xml.fx))
{
this._fxs = [];
for(const fx of xml.fx) this._fxs.push(new EffectFramePartXML(fx));
}
}
if(xml.bodypart !== undefined)
{
if(Array.isArray(xml.bodypart))
{
this._bodyParts = [];
for(const bodypart of xml.bodypart) this._bodyParts.push(new EffectFramePartXML(bodypart));
}
}
}
public get repeats(): number
{
return this._repeats;
}
public get fxs(): EffectFramePartXML[]
{
return this._fxs;
}
public get bodyParts(): EffectFramePartXML[]
{
return this._bodyParts;
}
}

View File

@ -0,0 +1,45 @@
import { EffectFrameXML } from './EffectFrameXML';
export class OverrideXML
{
private readonly _name: string;
private readonly _override: string;
private readonly _frames: EffectFrameXML[];
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.name !== undefined) this._name = attributes.name;
if(attributes.override !== undefined) this._override = attributes.override;
}
if(xml.frame !== undefined)
{
if(Array.isArray(xml.frame))
{
this._frames = [];
for(const frame of xml.frame) this._frames.push(new EffectFrameXML(frame));
}
}
}
public get name(): string
{
return this._name;
}
public get override(): string
{
return this._override;
}
public get frames(): EffectFrameXML[]
{
return this._frames;
}
}

View File

@ -0,0 +1,19 @@
export class RemoveXML
{
private readonly _id: string;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.id !== undefined) this._id = attributes.id;
}
}
public get id(): string
{
return this._id;
}
}

View File

@ -0,0 +1,19 @@
export class ShadowXML
{
private readonly _id: string;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.id !== undefined) this._id = attributes.id;
}
}
public get id(): string
{
return this._id;
}
}

View File

@ -0,0 +1,66 @@
import { DirectionXML } from './DirectionXML';
export class SpriteXML
{
private readonly _id: string;
private readonly _member: string;
private readonly _directions: number;
private readonly _staticY: number;
private readonly _ink: number;
private readonly _directionList: DirectionXML[];
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.id !== undefined) this._id = attributes.id;
if(attributes.member !== undefined) this._member = attributes.member;
if(attributes.directions !== undefined) this._directions = parseInt(attributes.directions);
if(attributes.staticY !== undefined) this._staticY = parseInt(attributes.staticY);
if(attributes.ink !== undefined) this._ink = parseInt(attributes.ink);
}
if(xml.direction !== undefined)
{
if(Array.isArray(xml.direction))
{
this._directionList = [];
for(const direction of xml.direction) this._directionList.push(new DirectionXML(direction));
}
}
}
public get id(): string
{
return this._id;
}
public get member(): string
{
return this._member;
}
public get directions(): number
{
return this._directions;
}
public get staticY(): number
{
return this._staticY;
}
public get ink(): number
{
return this._ink;
}
public get directionList(): DirectionXML[]
{
return this._directionList;
}
}

View File

@ -0,0 +1,12 @@
export * from './AddXML';
export * from './AvatarXML';
export * from './DirectionOffsetXML';
export * from './DirectionXML';
export * from './EffectAnimationXML';
export * from './EffectFramePartItemXML';
export * from './EffectFramePartXML';
export * from './EffectFrameXML';
export * from './OverrideXML';
export * from './RemoveXML';
export * from './ShadowXML';
export * from './SpriteXML';

View File

@ -1,3 +1,4 @@
export * from './animation';
export * from './assets';
export * from './index';
export * from './IndexXML';

View File

@ -0,0 +1,40 @@
export class ManifestLibraryAliasXML
{
private _name: string;
private _link: string;
private _flipH: boolean;
private _flipV: boolean;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes !== undefined)
{
if(attributes.name !== undefined) this._name = attributes.name;
if(attributes.link !== undefined) this._link = attributes.link;
if(attributes.fliph !== undefined) this._flipH = (attributes.fliph === '1');
if(attributes.flipv !== undefined) this._flipV = (attributes.flipv === '1');
}
}
public get name(): string
{
return this._name;
}
public get link(): string
{
return this._link;
}
public get flipH(): boolean
{
return this._flipH;
}
public get flipV(): boolean
{
return this._flipV;
}
}

View File

@ -1,3 +1,4 @@
import { ManifestLibraryAliasXML } from './ManifestLibraryAliasXML';
import { ManifestLibraryAssetXML } from './ManifestLibraryAssetXML';
export class ManifestLibraryXML
@ -5,6 +6,7 @@ export class ManifestLibraryXML
private readonly _name: string;
private readonly _version: string;
private readonly _assets: ManifestLibraryAssetXML[];
private readonly _aliases: ManifestLibraryAliasXML[];
constructor(xml: any)
{
@ -22,11 +24,27 @@ export class ManifestLibraryXML
{
this._assets = [];
for(const assetPartParent of xml.assets)
for(const assetParent of xml.assets)
{
if(Array.isArray(assetPartParent.asset))
if(Array.isArray(assetParent.asset))
{
for(const asset of assetPartParent.asset) this._assets.push(new ManifestLibraryAssetXML(asset));
for(const asset of assetParent.asset) this._assets.push(new ManifestLibraryAssetXML(asset));
}
}
}
}
if(xml.aliases !== undefined)
{
if(Array.isArray(xml.aliases))
{
this._aliases = [];
for(const aliasParent of xml.aliases)
{
if(Array.isArray(aliasParent.alias))
{
for(const alias of aliasParent.alias) this._aliases.push(new ManifestLibraryAliasXML(alias));
}
}
}
@ -37,4 +55,9 @@ export class ManifestLibraryXML
{
return this._assets;
}
public get aliases(): ManifestLibraryAliasXML[]
{
return this._aliases;
}
}

View File

@ -1,3 +1,4 @@
export * from './ManifestLibraryAliasXML';
export * from './ManifestLibraryAssetParamXML';
export * from './ManifestLibraryAssetXML';
export * from './ManifestLibraryXML';

View File

@ -6,6 +6,7 @@ export class AnimationXML
private readonly _transitionTo: number;
private readonly _transitionFrom: number;
private readonly _immediateChangeFrom: string;
private readonly _randomStart: boolean;
private readonly _layers: AnimationLayerXML[];
constructor(xml: any)
@ -18,6 +19,7 @@ export class AnimationXML
if(attributes.transitionTo !== undefined) this._transitionTo = parseInt(attributes.transitionTo);
if(attributes.transitionFrom !== undefined) this._transitionFrom = parseInt(attributes.transitionFrom);
if(attributes.immediateChangeFrom !== undefined) this._immediateChangeFrom = attributes.immediateChangeFrom;
if(attributes.randomStart !== undefined) this._randomStart = (attributes.randomStart === '1');
}
if(xml.animationLayer !== undefined)
@ -51,6 +53,11 @@ export class AnimationXML
return this._immediateChangeFrom;
}
public get randomStart(): boolean
{
return this._randomStart;
}
public get layers(): AnimationLayerXML[]
{
return this._layers;

View File

@ -0,0 +1,26 @@
export class EffectLibraryPartXML
{
private _id: number;
private _type: string;
constructor(xml: any)
{
const attributes = xml.$;
if(attributes)
{
if(attributes.id !== undefined) this._id = parseInt(attributes.id);
if(attributes.type !== undefined) this._type = attributes.type;
}
}
public get id(): number
{
return this._id;
}
public get type(): string
{
return this._type;
}
}

View File

@ -0,0 +1,46 @@
import { EffectLibraryPartXML } from './EffectLibraryPartXML';
export class EffectLibraryXML
{
private _id: string;
private _revision: number;
private _parts: EffectLibraryPartXML[];
constructor(xml: any)
{
const attributes = xml.$;
if(attributes)
{
if(attributes.id !== undefined) this._id = attributes.id;
if(attributes.revision !== undefined) this._revision = parseInt(attributes.revision);
}
if(xml.part !== undefined)
{
this._parts = [];
for(const partId in xml.part)
{
const part = xml.part[partId];
this._parts.push(new EffectLibraryPartXML(part));
}
}
}
public get id(): string
{
return this._id;
}
public get revision(): number
{
return this._revision;
}
public get parts(): EffectLibraryPartXML[]
{
return this._parts;
}
}

View File

@ -0,0 +1,29 @@
import { EffectLibraryXML } from './EffectLibraryXML';
export class EffectMapXML
{
private _librares: EffectLibraryXML[];
constructor(xml: any)
{
if(xml.map !== undefined)
{
if(xml.map.lib !== undefined)
{
this._librares = [];
for(const lib in xml.map.lib)
{
const library = xml.map.lib[lib];
this._librares.push(new EffectLibraryXML(library));
}
}
}
}
public get libraries(): EffectLibraryXML[]
{
return this._librares;
}
}

View File

@ -0,0 +1,3 @@
export * from './EffectLibraryPartXML';
export * from './EffectLibraryXML';
export * from './EffectMapXML';

View File

@ -1,2 +1,4 @@
export * from './asset';
export * from './effectmap';
export * from './figuremap';
export * from './furnidata';