Module RunnerFiles
A file access object used by a Game Runner program to read and write data files or programs to disk. It's only allowed to access files under the runners
, bots/runners
, and stages/runners
subdirectories.
Functions
botExists (filename) | Checks if a bot file exists. |
exists (filename) | Checks if a data file exists. |
read (filename) | Reads the contents of a data file. |
readBot (filename) | Reads the contents of a bot file. |
readStage (filename) | Reads the contents of a stage file. |
stageExists (filename) | Checks if a stage file exists. |
write (filename, contents) | Writes a data file to disk. |
writeBot (filename, contents) | Writes a bot file to disk. |
writeStage (filename, contents) | Writes a stage file to disk. |
Functions
- botExists (filename)
-
Checks if a bot file exists.
Parameters
-
filename: The name of the file under the
bots/runners
subdirectory.
Return value:
true
if the file exists,false
otherwise. -
filename: The name of the file under the
- exists (filename)
-
Checks if a data file exists.
Parameters
-
filename: The name of the file under the
runners
subdirectory.
Return value:
true
if the file exists,false
otherwise. -
filename: The name of the file under the
- read (filename)
-
Reads the contents of a data file.
Parameters
-
filename: The name of the file under the
runners
subdirectory.
Return value:
The contents of the file as a string, ornil
if the file doesn't exist. -
filename: The name of the file under the
- readBot (filename)
-
Reads the contents of a bot file.
Parameters
-
filename: The name of the file under the
bots/runners
subdirectory.
Return value:
The contents of the file as a string, ornil
if the file doesn't exist. -
filename: The name of the file under the
- readStage (filename)
-
Reads the contents of a stage file.
Parameters
-
filename: The name of the file under the
stages/runners
subdirectory.
Return value:
The contents of the file as a string, ornil
if the file doesn't exist. -
filename: The name of the file under the
- stageExists (filename)
-
Checks if a stage file exists.
Parameters
-
filename: The name of the file under the
stages/runners
subdirectory.
Return value:
true
if the file exists,false
otherwise. -
filename: The name of the file under the
- write (filename, contents)
-
Writes a data file to disk.
Parameters
-
filename: The name of the file under the
runners
subdirectory. - contents: The contents of the file as a string.
-
filename: The name of the file under the
- writeBot (filename, contents)
-
Writes a bot file to disk.
Parameters
-
filename: The name of the file under the
bots/runners
subdirectory. - contents: The contents of the file as a string.
-
filename: The name of the file under the
- writeStage (filename, contents)
-
Writes a stage file to disk.
Parameters
-
filename: The name of the file under the
stages/runners
subdirectory. - contents: The contents of the file as a string.
-
filename: The name of the file under the