Options
All
  • Public
  • Public/Protected
  • All
Menu

Cao-Lang

Repository

Install

npm install --save @caolo-game/cao-lang-wasm

Index

Functions

_start

  • _start(): void
  • Init the error handling of the library

    Returns void

basicSchema

  • basicSchema(): any[]
  • Return the basic cards accepted by this Cao-Lang instance

    Returns any[]

caoLangPropertyTypes

  • caoLangPropertyTypes(): any[]
  • Return a list of types that can appear on Property descriptions

    Returns any[]

compile

  • compile(compilation_unit: any, compile_options?: CompileOptions): any
  • The compile function will return an object with a compilationError if the compilation fails, rather than throwing an exception. Exceptions are thrown on contract violation, e.g. passing in an object that can not be deserialized into a compilable object.

    {
        "ty": "compileError",
        "val": "someerror"
    }

    ty is one of:

    {
        "lanes": [{
            "name": "Foo",
            "cards": [
                {
                    "ty": "ScalarInt" , "val": 1
                },
                {
                    "ty": "Pass"
                }
            ]
        }]
    }

    Parameters

    Returns any

runProgram

  • Runs the given compiled Cao-Lang program (output of compile).

    Will run in a 'plain' Vm, no custom methods will be available!

    Parameters

    • program: any

    Returns RunResult

versionInfo

Legend

  • Property
  • Method

Generated using TypeDoc