Skip to content

Commit

Permalink
feat: shuttle command
Browse files Browse the repository at this point in the history
  • Loading branch information
Balte de Wit committed Sep 21, 2019
1 parent ab5bf19 commit b412641
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { AbstractCommandNoResponse } from './abstractCommand'

export class RecordCommand extends AbstractCommandNoResponse {
filename?: string
append?: boolean

constructor (filename?: string) {
constructor (filename?: string, append?: boolean) {
super()

this.filename = filename
this.append = append
}

serialize () {
Expand All @@ -17,6 +19,7 @@ export class RecordCommand extends AbstractCommandNoResponse {
}

if (this.filename) res.params.name = this.filename
if (this.append !== undefined) res.params.append = this.append ? 'true' : 'false'

return res
}
Expand Down
23 changes: 23 additions & 0 deletions src/commands/shuttle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { NamedMessage } from '../message'
import { AbstractCommandNoResponse } from './abstractCommand'

export class SpeedCommand extends AbstractCommandNoResponse {
speed?: number

constructor (speed?: number) {
super()

this.speed = speed
}

serialize () {
const res: NamedMessage = {
name: 'speed',
params: {}
}

if (this.speed) res.params.speed = this.speed + ''

return res
}
}

0 comments on commit b412641

Please sign in to comment.