C# 클래스 Sharplike.Core.Game

Game is the core entry point of the Sharplike engine.
파일 보기 프로젝트 열기: eropple/sharplike

공개 메소드들

메소드 설명
Initialize ( ) : void

Creates a new game. The base directory will be the location of the .exe file that was run.

Initialize ( String basedir ) : void

Creates a new game.

PathTo ( IEnumerable location ) : String

Builds a full system path to the specified location from an IEnumerable of path components.

PathTo ( String location ) : String

Returns a full system path to the given location. Properly accounts for system differences. Regardless of your development platform, use the foreslash ("/") to separate path elements.

Process ( ) : void

Processes the game's core subsystems. Game function should not be called except by expert users.

PumpMessages ( ) : void

Pumps game messages. For expert users only!

RegisterTask ( IScheduledTask task ) : void

Thread Safe. Registers a new scheduled task to be run every step.

Run ( ) : void

Starts the game's processing and immediately returns. For expert users only!

Run ( AbstractGameLoop loop ) : void

Starts the game's processing. Make sure that the game has been initialized through a call to Initialize() first. Game call will not return until the user has quit the game.

SendMessage ( IMessageReceiver target, String messagename ) : void

Thread safe. Send a message to a particular target.

SendMessage ( String channel, String messagename ) : void

Thread safe. Broadcasts a message to a channel.

SetAudioSystem ( String sys ) : void

Sets the audio engine to use.

SetInputSystem ( String sys ) : void

Sets the input system to use. WARNING: Many input systems (such as OpenTK) reference the rendering system for a window handle. Consult the documentation of your input system for details, but in general be sure to initialize your rendering system first.

SetRenderSystem ( String sys ) : void

Sets the rendering engine to use.

SetTick ( System.Int64 newTickValue ) : System.Int64

Used to set the value of the game loop's current tick. This is NOT being used as the property's setter because it must be stressed that this is a BAD THING TO MESS WITH. Only do so in established, defined situations (for example, setting the tick value of a restored saved game).

Step ( ) : void

Processes a single step of game code. This will be called every frame for realtime games. Should not be called except by expert users. Even they should reconsider.

Stop ( ) : void

Stops the game from running. For expert users only!

SubscribeToChannel ( String chan, IMessageReceiver subscriber ) : void

Thread safe. Subscribes a message receiver to a particular channel.

If an object is subscribed to a channel, it MUST be unsubscribed on destruction.

SubscribeToChannels ( IMessageReceiver subscriber ) : void

Thread safe. Automatically subscribe to all channels specified in class attributes.

If an object is subscribed to a channel, it MUST be unsubscribed on destruction.

Terminate ( ) : void

Call Game when your application's done. Disposes of Game and fires any OnGameTermination events.

UnregisterTask ( IScheduledTask task ) : void

Thread Safe. Unregisters a task from the task queue.

Unsubscribe ( IMessageReceiver subscriber ) : void

Thread safe. Unsubscribes an object from the whole post system. This object will no longer receive messages.

메소드 상세

Initialize() 공개 정적인 메소드

Creates a new game. The base directory will be the location of the .exe file that was run.
public static Initialize ( ) : void
리턴 void

Initialize() 공개 정적인 메소드

Creates a new game.
public static Initialize ( String basedir ) : void
basedir String The base application directory.
리턴 void

PathTo() 공개 정적인 메소드

Builds a full system path to the specified location from an IEnumerable of path components.
public static PathTo ( IEnumerable location ) : String
location IEnumerable An enumerable collection of path components.
리턴 String

PathTo() 공개 정적인 메소드

Returns a full system path to the given location. Properly accounts for system differences. Regardless of your development platform, use the foreslash ("/") to separate path elements.
public static PathTo ( String location ) : String
location String The path to generate off of the game's BaseDirectory.
리턴 String

Process() 공개 정적인 메소드

Processes the game's core subsystems. Game function should not be called except by expert users.
public static Process ( ) : void
리턴 void

PumpMessages() 공개 정적인 메소드

Pumps game messages. For expert users only!
public static PumpMessages ( ) : void
리턴 void

RegisterTask() 공개 정적인 메소드

Thread Safe. Registers a new scheduled task to be run every step.
public static RegisterTask ( IScheduledTask task ) : void
task IScheduledTask The task to schedule.
리턴 void

Run() 공개 정적인 메소드

Starts the game's processing and immediately returns. For expert users only!
public static Run ( ) : void
리턴 void

Run() 공개 정적인 메소드

Starts the game's processing. Make sure that the game has been initialized through a call to Initialize() first. Game call will not return until the user has quit the game.
public static Run ( AbstractGameLoop loop ) : void
loop Sharplike.Core.Runtime.AbstractGameLoop The AbstractGameLoop that's responsible for delegating to game logic.
리턴 void

SendMessage() 공개 정적인 메소드

Thread safe. Send a message to a particular target.
public static SendMessage ( IMessageReceiver target, String messagename ) : void
target IMessageReceiver The target to send the message to.
messagename String The name of the message to send
리턴 void

SendMessage() 공개 정적인 메소드

Thread safe. Broadcasts a message to a channel.
public static SendMessage ( String channel, String messagename ) : void
channel String The channel to send to
messagename String The name of the message to send
리턴 void

SetAudioSystem() 공개 정적인 메소드

Sets the audio engine to use.
public static SetAudioSystem ( String sys ) : void
sys String The name of the audio engine. Default is "OpenTK".
리턴 void

SetInputSystem() 공개 정적인 메소드

Sets the input system to use. WARNING: Many input systems (such as OpenTK) reference the rendering system for a window handle. Consult the documentation of your input system for details, but in general be sure to initialize your rendering system first.
public static SetInputSystem ( String sys ) : void
sys String The name of the input system to use.
리턴 void

SetRenderSystem() 공개 정적인 메소드

Sets the rendering engine to use.
public static SetRenderSystem ( String sys ) : void
sys String The name of the rendering engine. Default is "OpenTK".
리턴 void

SetTick() 공개 정적인 메소드

Used to set the value of the game loop's current tick. This is NOT being used as the property's setter because it must be stressed that this is a BAD THING TO MESS WITH. Only do so in established, defined situations (for example, setting the tick value of a restored saved game).
public static SetTick ( System.Int64 newTickValue ) : System.Int64
newTickValue System.Int64 The new value of the current tick.
리턴 System.Int64

Step() 공개 정적인 메소드

Processes a single step of game code. This will be called every frame for realtime games. Should not be called except by expert users. Even they should reconsider.
public static Step ( ) : void
리턴 void

Stop() 공개 정적인 메소드

Stops the game from running. For expert users only!
public static Stop ( ) : void
리턴 void

SubscribeToChannel() 공개 정적인 메소드

Thread safe. Subscribes a message receiver to a particular channel.
If an object is subscribed to a channel, it MUST be unsubscribed on destruction.
public static SubscribeToChannel ( String chan, IMessageReceiver subscriber ) : void
chan String The channel to subscribe to.
subscriber IMessageReceiver The object that will receive messages.
리턴 void

SubscribeToChannels() 공개 정적인 메소드

Thread safe. Automatically subscribe to all channels specified in class attributes.
If an object is subscribed to a channel, it MUST be unsubscribed on destruction.
public static SubscribeToChannels ( IMessageReceiver subscriber ) : void
subscriber IMessageReceiver The object to create subscriptions for.
리턴 void

Terminate() 공개 정적인 메소드

Call Game when your application's done. Disposes of Game and fires any OnGameTermination events.
public static Terminate ( ) : void
리턴 void

UnregisterTask() 공개 정적인 메소드

Thread Safe. Unregisters a task from the task queue.
public static UnregisterTask ( IScheduledTask task ) : void
task IScheduledTask The task to unregister.
리턴 void

Unsubscribe() 공개 정적인 메소드

Thread safe. Unsubscribes an object from the whole post system. This object will no longer receive messages.
public static Unsubscribe ( IMessageReceiver subscriber ) : void
subscriber IMessageReceiver The object to unsubscribe.
리턴 void