-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Bill <[email protected]>
- Loading branch information
Showing
6 changed files
with
72 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/notifications/OfferRewardDeliveredMessageEvent.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 { OfferRewardDeliveredMessageParser } from '../../parser'; | ||
|
||
export class OfferRewardDeliveredMessageEvent extends MessageEvent implements IMessageEvent | ||
{ | ||
constructor(callBack: Function) | ||
{ | ||
super(callBack, OfferRewardDeliveredMessageParser); | ||
} | ||
|
||
public getParser(): OfferRewardDeliveredMessageParser | ||
{ | ||
return this.parser as OfferRewardDeliveredMessageParser; | ||
} | ||
} |
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
51 changes: 51 additions & 0 deletions
51
src/nitro/communication/messages/parser/notifications/OfferRewardDeliveredMessageParser.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,51 @@ | ||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api'; | ||
|
||
export class OfferRewardDeliveredMessageParser implements IMessageParser | ||
{ | ||
private _contentType: string; | ||
private _classId: number; | ||
private _name: string; | ||
private _description: string; | ||
|
||
public flush(): boolean | ||
{ | ||
this._contentType = null; | ||
this._classId = 0; | ||
this._name = null; | ||
this._description = null; | ||
|
||
return true; | ||
} | ||
|
||
public parse(wrapper: IMessageDataWrapper): boolean | ||
{ | ||
if(!wrapper) return false; | ||
|
||
this._contentType = wrapper.readString(); | ||
this._classId = wrapper.readInt(); | ||
this._name = wrapper.readString(); | ||
this._description = wrapper.readString(); | ||
|
||
return true; | ||
} | ||
|
||
public get contentType(): string | ||
{ | ||
return this._contentType; | ||
} | ||
|
||
public get classId(): number | ||
{ | ||
return this._classId; | ||
} | ||
|
||
public get name(): string | ||
{ | ||
return this._name; | ||
} | ||
|
||
public get description(): string | ||
{ | ||
return this._description; | ||
} | ||
} |
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