C# Class FSO.SimAntics.VM

Simantics Virtual Machine.
Show file Open project: RHY3756547/FreeSO Class Usage Examples

Public Properties

Property Type Description
BHAVDirty bool
CheckGlobalLink VMTSOGlobalLinkStub
EODHost VMEODHost
Entities List
GlobalState short[]
Headline VMHeadlineRendererProvider
LotName string
MyUID uint
PlatformState FSO.SimAntics.Model.VMPlatformState
Ready bool

Public Methods

Method Description
AddEntity ( FSO.SimAntics.VMEntity entity ) : void

Adds an entity to this Virtual Machine.

AddToObjList ( List list, FSO.SimAntics.VMEntity entity ) : void
Assemble ( FSO.Files.Formats.IFF.Chunks.BHAV bhav ) : FSO.SimAntics.VMRoutine

Assembles a set of instructions.

BHAVChanged ( FSO.Files.Formats.IFF.Chunks.BHAV bhav ) : void
CloseNet ( VMCloseNetReason reason ) : void
ForwardCommand ( VMNetCommandBodyAbstract cmd ) : void
GetGlobalValue ( ushort var ) : short

Gets a global value set for this Virtual Machine.

GetObjectById ( short id ) : FSO.SimAntics.VMEntity

Gets an entity from this VM.

GetObjectByPersist ( uint id ) : FSO.SimAntics.VMEntity
GetUserIP ( uint uid ) : string
Init ( ) : void

Initializes this Virtual Machine.

InternalTick ( ) : void
Load ( VMMarshal input ) : void
OnPacket ( NetworkClient Client, GonzoNet.ProcessedPacket Packet ) : void
RemoveEntity ( FSO.SimAntics.VMEntity entity ) : void

Removes an entity from this Virtual Machine.

ReplaceNet ( VMNetDriver driver ) : void
Reset ( ) : void
Sandbox ( ) : VMSandboxRestoreState
SandboxRestore ( VMSandboxRestoreState state ) : void
Save ( ) : VMMarshal
SendCommand ( VMNetCommandBodyAbstract cmd ) : void
SetGlobalValue ( ushort var, short value ) : bool

Sets a global value for this Virtual Machine.

SignalChatEvent ( VMChatEvent evt ) : void

Signals a chat event to all listeners. (usually a UI)

SignalDialog ( FSO.SimAntics.Model.VMDialogInfo info ) : void

Signals a Dialog to all listeners. (usually a UI)

SignalEODMessage ( VMNetEODMessageCmd msg ) : void
Update ( ) : void
VM ( VMContext context, VMNetDriver driver, VMHeadlineRendererProvider headline ) : System

Constructs a new Virtual Machine instance.

Private Methods

Method Description
BreakpointHit ( FSO.SimAntics.VMEntity entity ) : void
NextObjID ( ) : short

Finds the next free object ID and remembers it for use when making another object.

Tick ( ) : void
VM_OnBHAVChange ( ) : void

Method Details

AddEntity() public method

Adds an entity to this Virtual Machine.
public AddEntity ( FSO.SimAntics.VMEntity entity ) : void
entity FSO.SimAntics.VMEntity The entity to add.
return void

AddToObjList() public static method

public static AddToObjList ( List list, FSO.SimAntics.VMEntity entity ) : void
list List
entity FSO.SimAntics.VMEntity
return void

Assemble() public method

Assembles a set of instructions.
public Assemble ( FSO.Files.Formats.IFF.Chunks.BHAV bhav ) : FSO.SimAntics.VMRoutine
bhav FSO.Files.Formats.IFF.Chunks.BHAV The instruction set to assemble.
return FSO.SimAntics.VMRoutine

BHAVChanged() public static method

public static BHAVChanged ( FSO.Files.Formats.IFF.Chunks.BHAV bhav ) : void
bhav FSO.Files.Formats.IFF.Chunks.BHAV
return void

CloseNet() public method

public CloseNet ( VMCloseNetReason reason ) : void
reason VMCloseNetReason
return void

ForwardCommand() public method

public ForwardCommand ( VMNetCommandBodyAbstract cmd ) : void
cmd FSO.SimAntics.NetPlay.Model.VMNetCommandBodyAbstract
return void

GetGlobalValue() public method

Gets a global value set for this Virtual Machine.
public GetGlobalValue ( ushort var ) : short
var ushort The index of the global value to get. WARNING: Throws exception if index is OOB. /// Must be in range of 0 - 31.
return short

GetObjectById() public method

Gets an entity from this VM.
public GetObjectById ( short id ) : FSO.SimAntics.VMEntity
id short The entity's ID.
return FSO.SimAntics.VMEntity

GetObjectByPersist() public method

public GetObjectByPersist ( uint id ) : FSO.SimAntics.VMEntity
id uint
return FSO.SimAntics.VMEntity

GetUserIP() public method

public GetUserIP ( uint uid ) : string
uid uint
return string

Init() public method

Initializes this Virtual Machine.
public Init ( ) : void
return void

InternalTick() public method

public InternalTick ( ) : void
return void

Load() public method

public Load ( VMMarshal input ) : void
input FSO.SimAntics.Marshals.VMMarshal
return void

OnPacket() public method

public OnPacket ( NetworkClient Client, GonzoNet.ProcessedPacket Packet ) : void
Client GonzoNet.NetworkClient
Packet GonzoNet.ProcessedPacket
return void

RemoveEntity() public method

Removes an entity from this Virtual Machine.
public RemoveEntity ( FSO.SimAntics.VMEntity entity ) : void
entity FSO.SimAntics.VMEntity The entity to remove.
return void

ReplaceNet() public method

public ReplaceNet ( VMNetDriver driver ) : void
driver FSO.SimAntics.NetPlay.VMNetDriver
return void

Reset() public method

public Reset ( ) : void
return void

Sandbox() public method

public Sandbox ( ) : VMSandboxRestoreState
return VMSandboxRestoreState

SandboxRestore() public method

public SandboxRestore ( VMSandboxRestoreState state ) : void
state VMSandboxRestoreState
return void

Save() public method

public Save ( ) : VMMarshal
return FSO.SimAntics.Marshals.VMMarshal

SendCommand() public method

public SendCommand ( VMNetCommandBodyAbstract cmd ) : void
cmd FSO.SimAntics.NetPlay.Model.VMNetCommandBodyAbstract
return void

SetGlobalValue() public method

Sets a global value for this Virtual Machine.
public SetGlobalValue ( ushort var, short value ) : bool
var ushort Index for value, must be in range 0 - 31.
value short Global value.
return bool

SignalChatEvent() public method

Signals a chat event to all listeners. (usually a UI)
public SignalChatEvent ( VMChatEvent evt ) : void
evt VMChatEvent
return void

SignalDialog() public method

Signals a Dialog to all listeners. (usually a UI)
public SignalDialog ( FSO.SimAntics.Model.VMDialogInfo info ) : void
info FSO.SimAntics.Model.VMDialogInfo The dialog info to pass along.
return void

SignalEODMessage() public method

public SignalEODMessage ( VMNetEODMessageCmd msg ) : void
msg VMNetEODMessageCmd
return void

Update() public method

public Update ( ) : void
return void

VM() public method

Constructs a new Virtual Machine instance.
public VM ( VMContext context, VMNetDriver driver, VMHeadlineRendererProvider headline ) : System
context VMContext The VMContext instance to use.
driver FSO.SimAntics.NetPlay.VMNetDriver
headline VMHeadlineRendererProvider
return System

Property Details

BHAVDirty public property

public bool BHAVDirty
return bool

CheckGlobalLink public property

public VMTSOGlobalLinkStub CheckGlobalLink
return VMTSOGlobalLinkStub

EODHost public property

public VMEODHost EODHost
return VMEODHost

Entities public property

public List Entities
return List

GlobalState public property

public short[] GlobalState
return short[]

Headline public property

public VMHeadlineRendererProvider Headline
return VMHeadlineRendererProvider

LotName public property

public string LotName
return string

MyUID public property

public uint MyUID
return uint

PlatformState public property

public VMPlatformState,FSO.SimAntics.Model PlatformState
return FSO.SimAntics.Model.VMPlatformState

Ready public property

public bool Ready
return bool