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#28 - CameraSnapshotMessageEvent added
- Loading branch information
Showing
6 changed files
with
56 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/camera/CameraSnapshotMessageEvent.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 { CameraSnapshotMessageParser } from '../../parser'; | ||
|
||
export class CameraSnapshotMessageEvent extends MessageEvent implements IMessageEvent | ||
{ | ||
constructor(callBack: Function) | ||
{ | ||
super(callBack, CameraSnapshotMessageParser); | ||
} | ||
|
||
public getParser(): CameraSnapshotMessageParser | ||
{ | ||
return this.parser as CameraSnapshotMessageParser; | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
src/nitro/communication/messages/parser/camera/CameraSnapshotMessageParser.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,35 @@ | ||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api'; | ||
|
||
export class CameraSnapshotMessageParser implements IMessageParser | ||
{ | ||
private _roomType: string; | ||
private _roomId: number; | ||
|
||
public flush(): boolean | ||
{ | ||
this._roomType = null; | ||
this._roomId = -1; | ||
|
||
return true; | ||
} | ||
|
||
public parse(wrapper: IMessageDataWrapper): boolean | ||
{ | ||
if(!wrapper) return false; | ||
|
||
this._roomType = wrapper.readString(); | ||
this._roomId = wrapper.readInt(); | ||
|
||
return true; | ||
} | ||
|
||
public get roomType(): string | ||
{ | ||
return this._roomType; | ||
} | ||
|
||
public get roomId(): number | ||
{ | ||
return this._roomId; | ||
} | ||
} |
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