Skip to content

Commit

Permalink
Made echo and quit part of the base api
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrw committed Sep 20, 2023
1 parent 2169896 commit 952ee3c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/models/bot_code_template.nim.nimf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#? stdtmpl
#proc bot_code_template(file_name, imports: string): string =
import system except echo, quit
import std / [strutils]
import types, class_macros, players, state_machine, base_api, bots, builds,
import types, class_macros, players, state_machine, base_api, bots, builds,
signs, bots_private
include overrides

let instance_global_by_default = true
var move_mode = 1
Expand Down
4 changes: 2 additions & 2 deletions src/models/build_code_template.nim.nimf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#? stdtmpl
#proc build_code_template(file_name, imports: string): string =
import system except echo, quit
import std / [strutils]
import types, class_macros, players, state_machine, base_api, bots, builds,
import types, class_macros, players, state_machine, base_api, bots, builds,
signs, builds_private
include overrides

let instance_global_by_default = false
var move_mode = 1
Expand Down
2 changes: 1 addition & 1 deletion src/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type
BlockTargetVisible, ReticleVisible, DocsVisible, MouseCaptured,
PrimaryDown, SecondaryDown, EditorFocused, ConsoleFocused, DocsFocused,
Playing, Flying, God,
LoadingScript, Server, Quitting
LoadingScript, Server, Quitting, ResettingVM

GlobalStateFlags* = enum
LoadingWorld
Expand Down
6 changes: 6 additions & 0 deletions vmlib/enu/base_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import types, state_machine, base_bridge, base_bridge_private

export base_bridge

proc echo*(args: varargs[string, `$`]) =
echo_console(args.join)

proc quit*(code = 0, msg = "") =
exit(code, msg)

proc `position=`*(self: Unit, position: Vector3) = self.position_set(position)
proc `position=`*(self: Unit, unit: Unit) = self.position_set(unit.position)

Expand Down
5 changes: 0 additions & 5 deletions vmlib/enu/overrides.nim

This file was deleted.

0 comments on commit 952ee3c

Please sign in to comment.