C# 클래스 TeaseAI_CE.Scripting.VM

Main 'world' object, needs to know about all scripts, personalities, controllers, functions, etc..
상속: IKeyed
파일 보기 프로젝트 열기: TeaseAI/TeaseAI-CE 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Punctuation char[]

공개 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

AddFunction() 공개 메소드

public AddFunction ( System.Function func ) : void
func System.Function
리턴 void

AddFunction() 공개 메소드

public AddFunction ( string name, System.Function func ) : void
name string
func System.Function
리턴 void

ChangePersonalityID() 공개 메소드

public ChangePersonalityID ( Personality p, string newID ) : bool
p Personality
newID string
리턴 bool

CreateController() 공개 메소드

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

CreatePersonality() 공개 메소드

Craete a new personality with given name.
public CreatePersonality ( string name ) : Personality
name string
리턴 Personality

Get() 공개 메소드

public Get ( Key key, Logger log = null ) : Variable
key Key
log Logger
리턴 Variable

GetAllControllers() 공개 메소드

public GetAllControllers ( ) : TeaseAI_CE.Scripting.Controller[]
리턴 TeaseAI_CE.Scripting.Controller[]

GetGroups() 공개 메소드

public GetGroups ( ) : TeaseAI_CE.Scripting.GroupInfo[]
리턴 TeaseAI_CE.Scripting.GroupInfo[]

GetPersonalities() 공개 메소드

public GetPersonalities ( ) : TeaseAI_CE.Scripting.Personality[]
리턴 TeaseAI_CE.Scripting.Personality[]

GetScriptResponse() 공개 메소드

public GetScriptResponse ( string keyword ) : BlockBase
keyword string
리턴 BlockBase

InputToShorthand() 공개 메소드

Runs text through input replace, to convert to shorthand.
public InputToShorthand ( string text ) : string
text string
리턴 string

KeyClean() 공개 정적인 메소드

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

KeyClean() 공개 정적인 메소드

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

KeySplit() 공개 정적인 메소드

public static KeySplit ( string key ) : string[]
key string
리턴 string[]

LoadFromDirectory() 공개 메소드

Load files in path and all sub directories.
public LoadFromDirectory ( string path ) : void
path string
리턴 void

QueryScript() 공개 메소드

public QueryScript ( VType query, Logger log ) : Script
query VType
log Logger
리턴 Script

QueryScript() 공개 메소드

public QueryScript ( Variable query, Logger log ) : Script
query Variable
log Logger
리턴 Script

RemoveController() 공개 메소드

public RemoveController ( Controller c ) : void
c Controller
리턴 void

RunPersonalitySetup() 공개 메소드

public RunPersonalitySetup ( ) : void
리턴 void

SanitizeInputReplace() 공개 정적인 메소드

Sanitize a string for use in the input replace system.
public static SanitizeInputReplace ( string str ) : string
str string
리턴 string

SanitizeInputReplace() 공개 정적인 메소드

Sanitize strings for use in the input replace system.
public static SanitizeInputReplace ( string strings ) : string[]
strings string
리턴 string[]

Start() 공개 메소드

Starts the controller update thread
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stop controller updating.
public Stop ( ) : void
리턴 void

TryGetPersonality() 공개 메소드

public TryGetPersonality ( string name, Personality &p ) : bool
name string
p Personality
리턴 bool

VM() 공개 메소드

public VM ( ) : System
리턴 System

Validate() 공개 메소드

public Validate ( ) : void
리턴 void

프로퍼티 상세

Punctuation 공개적으로 정적으로 프로퍼티

public static char[] Punctuation
리턴 char[]