diff --git a/src/nitro/communication/messages/parser/group/utils/GroupDataParser.ts b/src/nitro/communication/messages/parser/group/utils/GroupDataParser.ts deleted file mode 100644 index 249d7406..00000000 --- a/src/nitro/communication/messages/parser/group/utils/GroupDataParser.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core'; - -export class GroupDataParser -{ - private _id: number; - private _title: string; - private _badge: string; - private _colorA: string; - private _colorB: string; - private _ownerOrFavorite: boolean; - private _ownerId: number; - private _hasForum: boolean; - - constructor(wrapper: IMessageDataWrapper) - { - if(!wrapper) throw new Error('invalid_wrapper'); - - this.flush(); - this.parse(wrapper); - } - - public flush(): boolean - { - this._id = 0; - this._title = null; - this._badge = null; - this._colorA = null; - this._colorB = null; - this._ownerOrFavorite = null; - this._ownerId = 0; - this._hasForum = false; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._id = wrapper.readInt(); - this._title = wrapper.readString(); - this._badge = wrapper.readString(); - this._colorA = wrapper.readString(); - this._colorB = wrapper.readString(); - this._ownerOrFavorite = wrapper.readBoolean(); - this._ownerId = wrapper.readInt(); - this._hasForum = wrapper.readBoolean(); - - return true; - } - - public get id(): number - { - return this._id; - } - - public get title(): string - { - return this._title; - } - - public get badge(): string - { - return this._badge; - } - - public get colorA(): string - { - return this._colorA; - } - - public get colorB(): string - { - return this._colorB; - } - - public get ownerOrFavorite(): boolean - { - return this._ownerOrFavorite; - } - - public get ownerId(): number - { - return this._ownerId; - } - - public get hasForum(): boolean - { - return this._hasForum; - } -} diff --git a/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts b/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts index a0317d6f..5a0124ab 100644 --- a/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts +++ b/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts @@ -1,5 +1,5 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -import { GroupDataParser } from '../../group/utils/GroupDataParser'; +import { HabboGroupEntryData } from '../HabboGroupEntryData'; export class UserProfileParser implements IMessageParser { @@ -13,7 +13,7 @@ export class UserProfileParser implements IMessageParser private _isMyFriend: boolean; private _requestSent: boolean; private _isOnline: boolean; - private _groups: GroupDataParser[]; + private _groups: HabboGroupEntryData[]; private _secondsSinceLastVisit: number; private _openProfileWindow: boolean; @@ -54,7 +54,7 @@ export class UserProfileParser implements IMessageParser for(let i = 0; i < groupsCount; i++) { - this._groups.push(new GroupDataParser(wrapper)); + this._groups.push(new HabboGroupEntryData(wrapper)); } this._secondsSinceLastVisit = wrapper.readInt(); @@ -113,7 +113,7 @@ export class UserProfileParser implements IMessageParser return this._isOnline; } - public get groups(): GroupDataParser[] + public get groups(): HabboGroupEntryData[] { return this._groups; }