cleaned pet breeding parsers

This commit is contained in:
Dank074 2021-06-23 05:50:57 -05:00
parent 56c60c3e29
commit b6b50baf00
10 changed files with 123 additions and 123 deletions

View File

@ -1,8 +1,8 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
export class _Str_3763
export class BreedingPetInfo
{
private _Str_7992: number;
private _webId: number;
private _name: string;
private _level: number;
private _figure: string;
@ -12,7 +12,7 @@ export class _Str_3763
{
if(!wrapper) throw new Error('invalid_wrapper');
this._Str_7992 = wrapper.readInt();
this._webId = wrapper.readInt();
this._name = wrapper.readString();
this._level = wrapper.readInt();
this._figure = wrapper.readString();
@ -21,16 +21,16 @@ export class _Str_3763
public dispose():void
{
this._Str_7992 = 0;
this._webId = 0;
this._name = '';
this._level = 0;
this._figure = '';
this._owner = '';
}
public get _Str_5277(): number
public get webId(): number
{
return this._Str_7992;
return this._webId;
}
public get name(): string
@ -52,4 +52,4 @@ export class _Str_3763
{
return this._owner;
}
}
}

View File

@ -1,15 +1,15 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
export class _Str_5753
export class RarityCategoryData
{
private _Str_16211: number;
private _chance: number;
private _breeds: number[];
constructor(wrapper: IMessageDataWrapper)
{
if(!wrapper) throw new Error('invalid_wrapper');
this._Str_16211 = wrapper.readInt();
this._chance = wrapper.readInt();
this._breeds = [];
let totalCount = wrapper.readInt();
@ -24,17 +24,17 @@ export class _Str_5753
public dispose():void
{
this._Str_16211 = -1;
this._chance = -1;
this._breeds = [];
}
public get _Str_12554(): number
public get chance(): number
{
return this._Str_16211;
return this._chance;
}
public get breeds(): number[]
{
return this._breeds;
}
}
}

View File

@ -1,4 +1,4 @@
export * from './BreedingPetInfo';
export * from './PetFigureUpdateEvent';
export * from './PetInfoEvent';
export * from './_Str_3763';
export * from './_Str_5753';
export * from './RarityCategoryData';

View File

@ -0,0 +1,83 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser';
import { BreedingPetInfo } from '../../../incoming/room/pet/BreedingPetInfo';
import { RarityCategoryData } from '../../../incoming/room/pet/RarityCategoryData';
export class ConfirmBreedingRequestParser implements IMessageParser
{
private _nestId: number;
private _pet1: BreedingPetInfo;
private _pet2: BreedingPetInfo;
private _rarityCategories: RarityCategoryData[];
private _resultPetType: number;
public flush(): boolean
{
this._nestId = 0;
if(this._pet1)
{
this._pet1.dispose();
this._pet1 = null;
}
if(this._pet2)
{
this._pet2.dispose();
this._pet2 = null;
}
for(const k of this._rarityCategories) k && k.dispose();
this._rarityCategories = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._nestId = wrapper.readInt();
this._pet1 = new BreedingPetInfo(wrapper);
this._pet2 = new BreedingPetInfo(wrapper);
let totalCount = wrapper.readInt();
while(totalCount > 0)
{
this._rarityCategories.push(new RarityCategoryData(wrapper));
totalCount--;
}
this._resultPetType = wrapper.readInt();
return true;
}
public get nestId(): number
{
return this._nestId;
}
public get pet1():BreedingPetInfo
{
return this._pet1;
}
public get pet2():BreedingPetInfo
{
return this._pet2;
}
public get rarityCategories(): RarityCategoryData[]
{
return this._rarityCategories;
}
public get resultPetType(): number
{
return this._resultPetType;
}
}

View File

@ -1,14 +1,14 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser';
export class _Str_6256 implements IMessageParser
export class ConfirmBreedingResultParser implements IMessageParser
{
private _Str_6143: number;
private _breedingNestStuffId: number;
private _result: number;
public flush(): boolean
{
this._Str_6143 = 0;
this._breedingNestStuffId = 0;
this._result = 0;
return true;
@ -18,19 +18,19 @@ export class _Str_6256 implements IMessageParser
{
if(!wrapper) return false;
this._Str_6143 = wrapper.readInt();
this._breedingNestStuffId = wrapper.readInt();
this._result = wrapper.readInt();
return true;
}
public get _Str_12769(): number
public get breedingNestStuffId(): number
{
return this._Str_6143;
return this._breedingNestStuffId;
}
public get result(): number
{
return this._result;
}
}
}

View File

@ -1,9 +1,9 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser';
export class _Str_7486 implements IMessageParser
export class GoToBreedingNestFailureParser implements IMessageParser
{
public static _Str_17785: number = 6;
public static PET_TOO_TIRED_TO_BREED: number = 6;
private _reason: number;
@ -23,4 +23,4 @@ export class _Str_7486 implements IMessageParser
{
return this._reason;
}
}
}

View File

@ -1,83 +0,0 @@
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser';
import { _Str_3763 } from '../../../incoming/room/pet/_Str_3763';
import { _Str_5753 } from '../../../incoming/room/pet/_Str_5753';
export class _Str_6719 implements IMessageParser
{
private _Str_5743: number;
private _pet1: _Str_3763;
private _pet2: _Str_3763;
private _Str_4447: _Str_5753[];
private _Str_21973: number;
public flush(): boolean
{
this._Str_5743 = 0;
if(this._pet1)
{
this._pet1.dispose();
this._pet1 = null;
}
if(this._pet2)
{
this._pet2.dispose();
this._pet2 = null;
}
for(const k of this._Str_4447) k && k.dispose();
this._Str_4447 = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._Str_5743 = wrapper.readInt();
this._pet1 = new _Str_3763(wrapper);
this._pet2 = new _Str_3763(wrapper);
let totalCount = wrapper.readInt();
while(totalCount > 0)
{
this._Str_4447.push(new _Str_5753(wrapper));
totalCount--;
}
this._Str_21973 = wrapper.readInt();
return true;
}
public get _Str_12369(): number
{
return this._Str_5743;
}
public get pet1():_Str_3763
{
return this._pet1;
}
public get pet2():_Str_3763
{
return this._pet2;
}
public get _Str_10346(): _Str_5753[]
{
return this._Str_4447;
}
public get _Str_24905(): number
{
return this._Str_21973;
}
}

View File

@ -1,3 +1,6 @@
export * from './ConfirmBreedingRequestParser';
export * from './ConfirmBreedingResultParser';
export * from './GoToBreedingNestFailureParser';
export * from './NestBreedingSuccessParser';
export * from './PetAddedToInventoryParser';
export * from './PetBoughtNotificationMessageParser';
@ -6,6 +9,3 @@ export * from './PetData';
export * from './PetFigureDataParser';
export * from './PetInventoryParser';
export * from './PetRemovedFromInventoryParser';
export * from './_Str_6256';
export * from './_Str_6719';
export * from './_Str_7486';

View File

@ -5,31 +5,31 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent
{
public static RSPFUE_CONFIRM_PET_BREEDING: string = 'RSPFUE_CONFIRM_PET_BREEDING';
private _Str_5743: number;
private _nestId: number;
private _pet1: any;
private _pet2: any;
private _Str_4447: any[];
private _rarityCategories: any[];
private _Str_6321: number;
constructor(k: IRoomSession, _arg_2: number, _arg_3: any, _arg_4: any, _arg_5: any[], _arg_6: number)
{
super(RoomSessionConfirmPetBreedingEvent.RSPFUE_CONFIRM_PET_BREEDING, k);
this._Str_5743 = _arg_2;
this._nestId = _arg_2;
this._pet1 = _arg_3;
this._pet2 = _arg_4;
this._Str_4447 = _arg_5;
this._rarityCategories = _arg_5;
this._Str_6321 = _arg_6;
}
public get _Str_10346(): any[]
public get rarityCategories(): any[]
{
return this._Str_4447;
return this._rarityCategories;
}
public get _Str_12369(): number
public get nestId(): number
{
return this._Str_5743;
return this._nestId;
}
public get pet1(): any
@ -46,4 +46,4 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent
{
return this._Str_6321;
}
}
}

View File

@ -16,7 +16,7 @@ export class RoomSessionConfirmPetBreedingResultEvent extends RoomSessionEvent
this._result = _arg_3;
}
public get _Str_12769(): number
public get breedingNestStuffId(): number
{
return this._breedingNestStuffId;
}
@ -25,4 +25,4 @@ export class RoomSessionConfirmPetBreedingResultEvent extends RoomSessionEvent
{
return this._result;
}
}
}