From d75129354548ed89f783cb29544638255256564a Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Sat, 1 May 2021 18:42:42 -0500 Subject: [PATCH] Added template, new instructions, and dev stuff. --- .flake8 | 2 ++ .gitignore | 3 ++- instruction.j2 | 6 +++++ new.masm | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ new.org | 60 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 .flake8 create mode 100644 instruction.j2 create mode 100644 new.masm create mode 100644 new.org diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..fd0c737 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore = E501, W503, E203, W191, E302, W293, E305 diff --git a/.gitignore b/.gitignore index 45f78f4..2746538 100755 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ .pytest_cache .vscode __pycache__ -compile_flags.txt \ No newline at end of file +compile_flags.txt +.dir-locals.el diff --git a/instruction.j2 b/instruction.j2 new file mode 100644 index 0000000..ac9fa1a --- /dev/null +++ b/instruction.j2 @@ -0,0 +1,6 @@ +class {{ subcommand|capitalize }}(Instruction): + def __init__(self, {% for param in params %}{{ param }}:str,{% endfor %}): + {% for param in params %}self.{{ param }} = {{ param }} + {% endfor %} + def __str__(self): + return f"{{ command }} {{subcommand}} {% for param in params %}{% raw %}{{% endraw %}self.{{ param }}{% raw %}}{% endraw %}{% if not loop.last %} {% endif %}{% endfor %}{% for i in range(length-params|length) %}{% if loop.first %} {% endif %}0{% if not loop.last %} {% endif %}{% endfor %}" diff --git a/new.masm b/new.masm new file mode 100644 index 0000000..5b720e3 --- /dev/null +++ b/new.masm @@ -0,0 +1,73 @@ +# template +#+begin_src masm + control shootp obj unit shoot 0 0 + control configure obj configure 0 0 0 + control color obj r g b 0 +#+end_src + +# manual +#+begin_src masm +ubind type +#+end_src +# template + +# toggles/set +#+begin_src masm +ucontrol boost enable 0 0 0 0 +ucontrol flag value 0 0 0 0 +#+end_src + +# direct commands +#+begin_src masm +ucontrol idle 0 0 0 0 0 +ucontrol stop 0 0 0 0 0 +ucontrol pathfind 0 0 0 0 0 +ucontrol payDrop 0 0 0 0 0 +#+end_src + +# direct with bool +#+begin_src masm +ucontrol payTake takeUnits 0 0 0 0 +#+end_src + +# xy-direct +#+begin_src masm +ucontrol move x y 0 0 0 +ucontrol mine x y 0 0 0 +#+end_src + +# xy-param-set +#+begin_src masm +ucontrol approach x y r 0 0 +control target x y shoot 0 0 +#+end_src + +# xy-param-get +#+begin_src masm +ucontrol within x y raduis result 0 +ucontrol getBlock x y type building 0 +#+end_src + +# other +#+begin_src masm +ucontrol targetp unit shoot 0 0 0 +ucontrol itemDrop to amount 0 0 0 +ucontrol itemTake from item amount 0 0 +ucontrol build x y block rotation config +#+end_src + + + + +# subclass from radar, no 'from' param +#+begin_src masm +uradar boss boss player armor 0 order result +#+end_src + +# manual/subclass +#+begin_src masm +ulocate ore core enemy @copper outx outy found building +ulocate building core enemy @copper outx outy found building +ulocate spawn core enemy @copper outx outy found building +ulocate damaged core enemy @copper outx outy found building +#+end_src diff --git a/new.org b/new.org new file mode 100644 index 0000000..568cbac --- /dev/null +++ b/new.org @@ -0,0 +1,60 @@ +* manual +#+begin_src masm +ubind type +#+end_src +* template +#+begin_src masm + control shootp obj unit shoot 0 0 + control configure obj configure 0 0 0 + control color obj r g b 0 +#+end_src +** toggles/set + #+begin_src masm + ucontrol boost enable 0 0 0 0 + ucontrol flag value 0 0 0 0 + #+end_src +** direct commands + #+begin_src masm + ucontrol idle 0 0 0 0 0 + ucontrol stop 0 0 0 0 0 + ucontrol pathfind 0 0 0 0 0 + ucontrol payDrop 0 0 0 0 0 + #+end_src +** direct with bool + #+begin_src masm + ucontrol payTake takeUnits 0 0 0 0 + #+end_src +** xy-direct + #+begin_src masm + ucontrol move x y 0 0 0 + ucontrol mine x y 0 0 0 + #+end_src +** xy-param-set + #+begin_src masm + ucontrol approach x y r 0 0 + control target x y shoot 0 0 + #+end_src +** xy-param-get + #+begin_src masm + ucontrol within x y raduis result 0 + ucontrol getBlock x y type building 0 + #+end_src +** other + #+begin_src masm + ucontrol targetp unit shoot 0 0 0 + ucontrol itemDrop to amount 0 0 0 + ucontrol itemTake from item amount 0 0 + ucontrol build x y block rotation config + #+end_src +* subclass +** radar, no 'from' param + #+begin_src masm + uradar boss boss player armor 0 order result + #+end_src +** manual + #+begin_src masm + ulocate ore core enemy @copper outx outy found building + ulocate building core enemy @copper outx outy found building + ulocate spawn core enemy @copper outx outy found building + ulocate damaged core enemy @copper outx outy found building + #+end_src