C# Class kOS.Safe.Function.SafeFunctionBase

Afficher le fichier Open project: KSP-KOS/KOS Class Usage Examples

Méthodes publiques

Méthode Description
Execute ( SafeSharedObjects shared ) : void

Méthodes protégées

Méthode Description
AssertArgBottomAndConsume ( SafeSharedObjects shared ) : void

A utility function that a function's Execute() must use after it has popped all the arguments it was expecting from the stack. It will assert that all the arguments have been consumed exactly, and the next item on the stack is the arg bottom mark. It will consume the arg bottom mark as well.
If the assert fails, an exception is thrown.

CountRemainingArgs ( SafeSharedObjects shared ) : int

A utility function that a function's Execute() may use if it wishes to, to get a count of how many args passed to it that it has not yet consumed still remain on the stack.

DegreesToRadians ( double degrees ) : double
GetDouble ( object argument ) : double
GetFuncName ( ) : string
GetInt ( object argument ) : int
PopStackAssert ( SafeSharedObjects shared ) : object

A utility function that a function's Execute() should use in place of cpu.PopStack(), because it will assert that the value being popped is NOT an ARG_MARKER_STRING, and if it is, it will throw the appropriate error.

PopStructureAssertEncapsulated ( SafeSharedObjects shared, bool barewordOkay = false ) : Structure

Identical to PopValueAssert, but with the additional step of coercing the result into a Structure to be sure, so it won't return primitives.

PopValueAssert ( SafeSharedObjects shared, bool barewordOkay = false ) : object

A utility function that a function's Execute() should use in place of cpu.PopValue(), because it will assert that the value being popped is NOT an ARG_MARKER_STRING, and if it is, it will throw the appropriate error.

RadiansToDegrees ( double radians ) : double
SafeFunctionBase ( ) : System

Method Details

AssertArgBottomAndConsume() protected méthode

A utility function that a function's Execute() must use after it has popped all the arguments it was expecting from the stack. It will assert that all the arguments have been consumed exactly, and the next item on the stack is the arg bottom mark. It will consume the arg bottom mark as well.
If the assert fails, an exception is thrown.
protected AssertArgBottomAndConsume ( SafeSharedObjects shared ) : void
shared SafeSharedObjects
Résultat void

CountRemainingArgs() protected méthode

A utility function that a function's Execute() may use if it wishes to, to get a count of how many args passed to it that it has not yet consumed still remain on the stack.
protected CountRemainingArgs ( SafeSharedObjects shared ) : int
shared SafeSharedObjects
Résultat int

DegreesToRadians() protected méthode

protected DegreesToRadians ( double degrees ) : double
degrees double
Résultat double

Execute() public abstract méthode

public abstract Execute ( SafeSharedObjects shared ) : void
shared SafeSharedObjects
Résultat void

GetDouble() protected méthode

protected GetDouble ( object argument ) : double
argument object
Résultat double

GetFuncName() protected méthode

protected GetFuncName ( ) : string
Résultat string

GetInt() protected méthode

protected GetInt ( object argument ) : int
argument object
Résultat int

PopStackAssert() protected méthode

A utility function that a function's Execute() should use in place of cpu.PopStack(), because it will assert that the value being popped is NOT an ARG_MARKER_STRING, and if it is, it will throw the appropriate error.
protected PopStackAssert ( SafeSharedObjects shared ) : object
shared SafeSharedObjects
Résultat object

PopStructureAssertEncapsulated() protected méthode

Identical to PopValueAssert, but with the additional step of coercing the result into a Structure to be sure, so it won't return primitives.
protected PopStructureAssertEncapsulated ( SafeSharedObjects shared, bool barewordOkay = false ) : Structure
shared SafeSharedObjects
barewordOkay bool
Résultat Structure

PopValueAssert() protected méthode

A utility function that a function's Execute() should use in place of cpu.PopValue(), because it will assert that the value being popped is NOT an ARG_MARKER_STRING, and if it is, it will throw the appropriate error.
protected PopValueAssert ( SafeSharedObjects shared, bool barewordOkay = false ) : object
shared SafeSharedObjects
barewordOkay bool
Résultat object

RadiansToDegrees() protected méthode

protected RadiansToDegrees ( double radians ) : double
radians double
Résultat double

SafeFunctionBase() protected méthode

protected SafeFunctionBase ( ) : System
Résultat System