C# 클래스 kOS.Safe.Compilation.Opcode

파일 보기 프로젝트 열기: KSP-KOS/KOS

공개 프로퍼티들

프로퍼티 타입 설명
SourcePath kOS.Safe.Persistence.GlobalPath

공개 메소드들

메소드 설명
Execute ( ICpu cpu ) : void
GetArgumentDefs ( ) : IEnumerable

Return the list of member Properties that are part of what gets stored to machine langauge for this opcode.

InitMachineCodeData ( ) : void

This is intended to be called once, during the mod's initialization, and never again. It builds the Dictionaries that look up the type of opcode given its string name or code.

PopulateFromMLFields ( List fields ) : void

Starting from an empty instance of this opcode that you can assume was created from the default constructor, populate the Opcode's properties from a list of all the [MLFields] saved to the machine language file.
This needs to be overridden only if your Opcode has declared [MLField]'s. If your Opcode has no [MLFields] then the generic base version of this method works well enough.

TODO: Perhaps add an assert to the Init methods that will throw up a NagMessage if it detects an Opcode has be defined which has [MLFields] but lacks an override of this method.

ToString ( ) : string
TypeFromCode ( ByteCode code ) : Type

Given a string value of Code, find the Opcode Type that uses that as its CodeName.

TypeFromName ( string name ) : Type

Given a string value of Name, find the Opcode Type that uses that as its Name.

보호된 메소드들

메소드 설명
Opcode ( ) : System
PopStructureAssertEncapsulated ( ICpu cpu, bool barewordOkay = false ) : Structure

A utility function that will do the same as a cpu.PopStructureEncapsulated, but with an additional check to ensure the value atop the stack isn't the arg bottom marker.

PopValueAssert ( ICpu cpu, bool barewordOkay = false ) : object

A utility function that will do a cpu.PopValue, but with an additional check to ensure the value atop the stack isn't the arg bottom marker.

PopValueAssertEncapsulated ( ICpu cpu, bool barewordOkay = false ) : object

A utility function that will do the same as a cpu.PopValueEncapsulated, but with an additional check to ensure the value atop the stack isn't the arg bottom marker.

비공개 메소드들

메소드 설명
MLFieldComparator ( MLArgInfo a1, MLArgInfo a2 ) : int

Delegate function used for Sort() of the MLFields on an Opcode. Should only be called on properties that have [MLField] attributes on them.

메소드 상세

Execute() 공개 메소드

public Execute ( ICpu cpu ) : void
cpu ICpu
리턴 void

GetArgumentDefs() 공개 메소드

Return the list of member Properties that are part of what gets stored to machine langauge for this opcode.
public GetArgumentDefs ( ) : IEnumerable
리턴 IEnumerable

InitMachineCodeData() 공개 정적인 메소드

This is intended to be called once, during the mod's initialization, and never again. It builds the Dictionaries that look up the type of opcode given its string name or code.
public static InitMachineCodeData ( ) : void
리턴 void

Opcode() 보호된 메소드

protected Opcode ( ) : System
리턴 System

PopStructureAssertEncapsulated() 보호된 메소드

A utility function that will do the same as a cpu.PopStructureEncapsulated, but with an additional check to ensure the value atop the stack isn't the arg bottom marker.
protected PopStructureAssertEncapsulated ( ICpu cpu, bool barewordOkay = false ) : Structure
cpu ICpu
barewordOkay bool
리턴 Structure

PopValueAssert() 보호된 메소드

A utility function that will do a cpu.PopValue, but with an additional check to ensure the value atop the stack isn't the arg bottom marker.
protected PopValueAssert ( ICpu cpu, bool barewordOkay = false ) : object
cpu ICpu
barewordOkay bool
리턴 object

PopValueAssertEncapsulated() 보호된 메소드

A utility function that will do the same as a cpu.PopValueEncapsulated, but with an additional check to ensure the value atop the stack isn't the arg bottom marker.
protected PopValueAssertEncapsulated ( ICpu cpu, bool barewordOkay = false ) : object
cpu ICpu
barewordOkay bool
리턴 object

PopulateFromMLFields() 공개 메소드

Starting from an empty instance of this opcode that you can assume was created from the default constructor, populate the Opcode's properties from a list of all the [MLFields] saved to the machine language file.
This needs to be overridden only if your Opcode has declared [MLField]'s. If your Opcode has no [MLFields] then the generic base version of this method works well enough.

TODO: Perhaps add an assert to the Init methods that will throw up a NagMessage if it detects an Opcode has be defined which has [MLFields] but lacks an override of this method.
public PopulateFromMLFields ( List fields ) : void
fields List A list of all the [MLFields] to populate the opcode with, /// given *IN ORDER* of their Ordering fields. This is important. If the /// opcode has 2 properties, one that was given attribute [MLField(10)] and the /// other that was given attribute [MLField(20)], then the one with ordering=10 /// will be the first one in this list, and the one with ordering=20 will be the /// second. You can process the list in the guaranteed assumption that the caller /// ordered the arguments this way.
/// NOTE: If the opcode has no MLField's attributes, then this may be passed in /// as null, rather than as a list of 0 items.
///
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

TypeFromCode() 공개 정적인 메소드

Given a string value of Code, find the Opcode Type that uses that as its CodeName.
public static TypeFromCode ( ByteCode code ) : Type
code ByteCode ByteCode to look up
리턴 System.Type

TypeFromName() 공개 정적인 메소드

Given a string value of Name, find the Opcode Type that uses that as its Name.
public static TypeFromName ( string name ) : Type
name string name to look up
리턴 System.Type

프로퍼티 상세

SourcePath 공개적으로 프로퍼티

public GlobalPath,kOS.Safe.Persistence SourcePath
리턴 kOS.Safe.Persistence.GlobalPath