forked from billsonnn/nitro-renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
billsonnn#9 - TalentTrackLevelMessageEvent added
- Loading branch information
Showing
6 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/nitro/communication/messages/incoming/talent/TalentTrackLevelMessageEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { IMessageEvent } from '../../../../../api'; | ||
import { MessageEvent } from '../../../../../events'; | ||
import { TalentTrackLevelMessageParser } from '../../parser'; | ||
|
||
export class TalentTrackLevelMessageEvent extends MessageEvent implements IMessageEvent | ||
{ | ||
constructor(callBack: Function) | ||
{ | ||
super(callBack, TalentTrackLevelMessageParser); | ||
} | ||
|
||
public getParser(): TalentTrackLevelMessageParser | ||
{ | ||
return this.parser as TalentTrackLevelMessageParser; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './TalentTrackLevelMessageEvent'; | ||
export * from './TalentTrackMessageEvent'; |
43 changes: 43 additions & 0 deletions
43
src/nitro/communication/messages/parser/talent/TalentTrackLevelMessageParser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api'; | ||
|
||
export class TalentTrackLevelMessageParser implements IMessageParser | ||
{ | ||
private _talentTrackName: string; | ||
private _level: number; | ||
private _maxLevel: number; | ||
|
||
public flush(): boolean | ||
{ | ||
this._talentTrackName = null; | ||
this._level = -1; | ||
this._maxLevel = -1; | ||
|
||
return true; | ||
} | ||
|
||
public parse(wrapper: IMessageDataWrapper): boolean | ||
{ | ||
if(!wrapper) return false; | ||
|
||
this._talentTrackName = wrapper.readString(); | ||
this._level = wrapper.readInt(); | ||
this._maxLevel = wrapper.readInt(); | ||
|
||
return true; | ||
} | ||
|
||
public get talentTrackName(): string | ||
{ | ||
return this._talentTrackName; | ||
} | ||
|
||
public get level(): number | ||
{ | ||
return this._level; | ||
} | ||
|
||
public get maxLevel(): number | ||
{ | ||
return this._maxLevel; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './TalentTrackLevel'; | ||
export * from './TalentTrackLevelMessageParser'; | ||
export * from './TalentTrackParser'; | ||
export * from './TalentTrackRewardProduct'; | ||
export * from './TalentTrackTask'; |