C# Class TeaseAI_CE.Scripting.VM

Main 'world' object, needs to know about all scripts, personalities, controllers, functions, etc..
Inheritance: IKeyed
Afficher le fichier Open project: TeaseAI/TeaseAI-CE Class Usage Examples

Méthodes publiques

Свойство Type Description
Punctuation char[]

Méthodes publiques

Méthode Description
AddFunction ( System.Function func ) : void
AddFunction ( string name, System.Function func ) : void
ChangePersonalityID ( Personality p, string newID ) : bool
CreateController ( string id, Logger log = null ) : Controller

Creates a new controller for the given personality.

CreatePersonality ( string name ) : Personality

Craete a new personality with given name.

Get ( Key key, Logger log = null ) : Variable
GetAllControllers ( ) : TeaseAI_CE.Scripting.Controller[]
GetGroups ( ) : TeaseAI_CE.Scripting.GroupInfo[]
GetPersonalities ( ) : TeaseAI_CE.Scripting.Personality[]
GetScriptResponse ( string keyword ) : BlockBase
InputToShorthand ( string text ) : string

Runs text through input replace, to convert to shorthand.

KeyClean ( string key, Logger log = null ) : string

Removes white-space, sets lowercase, removes invalid characters, trims white-space.

KeyClean ( string keys, Logger log = null ) : string[]

Removes white-space, sets lowercase, removes invalid characters, trims white-space.

KeySplit ( string key ) : string[]
LoadFromDirectory ( string path ) : void

Load files in path and all sub directories.

QueryScript ( VType query, Logger log ) : Script
QueryScript ( Variable query, Logger log ) : Script
RemoveController ( Controller c ) : void
RunPersonalitySetup ( ) : void
SanitizeInputReplace ( string str ) : string

Sanitize a string for use in the input replace system.

SanitizeInputReplace ( string strings ) : string[]

Sanitize strings for use in the input replace system.

Start ( ) : void

Starts the controller update thread

Stop ( ) : void

Stop controller updating.

TryGetPersonality ( string name, Personality &p ) : bool
VM ( ) : System
Validate ( ) : void

Private Methods

Méthode Description
ExecLine ( Context sender, string line, StringBuilder output ) : void

Execute a line of code.

KeyClean ( string key, bool &isFloat, bool &isPercent, Logger log = null ) : string

Removes white-space, sets lowercase, removes invalid characters, trims white-space.

addScript ( string type, string rootKey, string key, Script script, string tags, string responses ) : void
execParenthCheckAdd ( Context sender, List items, StringBuilder sb ) : void

Check whats in sb, then add it to the list. [float, bool, and, or, variable]

execParentheses ( Context sender, string str, int &i ) : TeaseAI_CE.Scripting.Variable[]

Recursively parses and executes everything in the parentheses, then returns variable array.

execSplitCommand ( Context sender, string str, int &i, string &key, Variable &args ) : void

gets key and parentheses as args.

getFileLines ( string file, Logger &log ) : List

Gets all lines in file, returns null on IOException.

isNumberChar ( char c ) : bool
parseBlock ( List rawLines, int &currentLine, int blockIndent, Logger log ) : Line[]

Parses rawLines in to blocks of code recursively based on blockIndent.

parseBlockStart ( string str, string &key, List &args, Logger log ) : void
parseCutLine ( string &str, int &indentCount ) : bool

Counts indentation, and trims white-space and comments from str.

parseInputReplace ( List rawLines, Logger log ) : void

Parses rawLines as csv for the input replace system

parseScriptGroup ( List rawLines, string filePath, string fileKey, Logger fileLog ) : void

Parses raw lines in to the system.

parseStringArray ( string str, int &i, Logger log ) : string[]

Parse [] as an array of strings

parseStringQuoted ( string str, int &i, Logger log ) : string

Parse "" as a string

runAllSetupOn ( Controller c, StringBuilder sb ) : void

Runs all setup scripts on the controller.

runAllSetupOn ( Personality p, StringBuilder sb ) : void

Runs all setup scripts on the personality.

runThroughScript ( Controller c, BlockBase s, StringBuilder sb ) : bool

Add script to controller, call next until false.

threadTick ( ) : void

Updates all controllers.

validateScript ( Controller c, Script s, Variable>.Dictionary vars, StringBuilder output ) : void

Method Details

AddFunction() public méthode

public AddFunction ( System.Function func ) : void
func System.Function
Résultat void

AddFunction() public méthode

public AddFunction ( string name, System.Function func ) : void
name string
func System.Function
Résultat void

ChangePersonalityID() public méthode

public ChangePersonalityID ( Personality p, string newID ) : bool
p Personality
newID string
Résultat bool

CreateController() public méthode

Creates a new controller for the given personality.
public CreateController ( string id, Logger log = null ) : Controller
id string
log Logger
Résultat Controller

CreatePersonality() public méthode

Craete a new personality with given name.
public CreatePersonality ( string name ) : Personality
name string
Résultat Personality

Get() public méthode

public Get ( Key key, Logger log = null ) : Variable
key Key
log Logger
Résultat Variable

GetAllControllers() public méthode

public GetAllControllers ( ) : TeaseAI_CE.Scripting.Controller[]
Résultat TeaseAI_CE.Scripting.Controller[]

GetGroups() public méthode

public GetGroups ( ) : TeaseAI_CE.Scripting.GroupInfo[]
Résultat TeaseAI_CE.Scripting.GroupInfo[]

GetPersonalities() public méthode

public GetPersonalities ( ) : TeaseAI_CE.Scripting.Personality[]
Résultat TeaseAI_CE.Scripting.Personality[]

GetScriptResponse() public méthode

public GetScriptResponse ( string keyword ) : BlockBase
keyword string
Résultat BlockBase

InputToShorthand() public méthode

Runs text through input replace, to convert to shorthand.
public InputToShorthand ( string text ) : string
text string
Résultat string

KeyClean() public static méthode

Removes white-space, sets lowercase, removes invalid characters, trims white-space.
public static KeyClean ( string key, Logger log = null ) : string
key string
log Logger
Résultat string

KeyClean() public static méthode

Removes white-space, sets lowercase, removes invalid characters, trims white-space.
public static KeyClean ( string keys, Logger log = null ) : string[]
keys string
log Logger
Résultat string[]

KeySplit() public static méthode

public static KeySplit ( string key ) : string[]
key string
Résultat string[]

LoadFromDirectory() public méthode

Load files in path and all sub directories.
public LoadFromDirectory ( string path ) : void
path string
Résultat void

QueryScript() public méthode

public QueryScript ( VType query, Logger log ) : Script
query VType
log Logger
Résultat Script

QueryScript() public méthode

public QueryScript ( Variable query, Logger log ) : Script
query Variable
log Logger
Résultat Script

RemoveController() public méthode

public RemoveController ( Controller c ) : void
c Controller
Résultat void

RunPersonalitySetup() public méthode

public RunPersonalitySetup ( ) : void
Résultat void

SanitizeInputReplace() public static méthode

Sanitize a string for use in the input replace system.
public static SanitizeInputReplace ( string str ) : string
str string
Résultat string

SanitizeInputReplace() public static méthode

Sanitize strings for use in the input replace system.
public static SanitizeInputReplace ( string strings ) : string[]
strings string
Résultat string[]

Start() public méthode

Starts the controller update thread
public Start ( ) : void
Résultat void

Stop() public méthode

Stop controller updating.
public Stop ( ) : void
Résultat void

TryGetPersonality() public méthode

public TryGetPersonality ( string name, Personality &p ) : bool
name string
p Personality
Résultat bool

VM() public méthode

public VM ( ) : System
Résultat System

Validate() public méthode

public Validate ( ) : void
Résultat void

Property Details

Punctuation public_oe static_oe property

public static char[] Punctuation
Résultat char[]