C# Class Bricklayer.Client.Game

The main game code
Inheritance: TomShane.Neoforce.Controls.Application
Mostra file Open project: Cyral/Bricklayer Class Usage Examples

Public Properties

Property Type Description
ContentPackData Bricklayer.Client.ContentPack
ContentPackIndex int
ContentPackName string
CurrentGameState GameState
DefaultFont Microsoft.Xna.Framework.Graphics.SpriteFont
Host string
Input InputHandler
IsMouseOnControl bool
MainWindow Bricklayer.Client.Interface.MainWindow
Map Bricklayer.Client.World.Map
MsgHandler Bricklayer.Client.Networking.MessageHandler
MyColor Color
MyHue int
MyID byte
MyIndex byte
NetManager Bricklayer.Client.Networking.NetworkManager
Port int
Random System.Random
Resolution Microsoft.Xna.Framework.Rectangle
TextureLoader Bricklayer.Client.TextureLoader
Username string

Public Methods

Method Description
CheckControlPos ( Control c, Point pos ) : bool
CheckPosition ( Point pos ) : bool

Checks to see if the mouse is over a control (Mostly used for seeing if you can place a block there)

Exit ( ) : void
Game ( ) : System

Protected Methods

Method Description
CreateMainWindow ( ) : TomShane.Neoforce.Controls.Window

Creates a new instance of the main UI window

Draw ( GameTime gameTime ) : void

This is called when the game should draw itself.

DrawScene ( GameTime gameTime ) : void

Draws content behind the UI interface

Initialize ( ) : void

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.

LoadContent ( ) : void

LoadContent will be called once per game and is the place to load all of your content.

Update ( GameTime gameTime ) : void

Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio.

Private Methods

Method Description
MainWindow_FocusGained ( object sender, TomShane e ) : void

Called when the MainWindow gains focus

Method Details

CheckControlPos() public method

public CheckControlPos ( Control c, Point pos ) : bool
c Control
pos Point
return bool

CheckPosition() public method

Checks to see if the mouse is over a control (Mostly used for seeing if you can place a block there)
public CheckPosition ( Point pos ) : bool
pos Point
return bool

CreateMainWindow() protected method

Creates a new instance of the main UI window
protected CreateMainWindow ( ) : TomShane.Neoforce.Controls.Window
return TomShane.Neoforce.Controls.Window

Draw() protected method

This is called when the game should draw itself.
protected Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
return void

DrawScene() protected method

Draws content behind the UI interface
protected DrawScene ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
return void

Exit() public method

public Exit ( ) : void
return void

Game() public method

public Game ( ) : System
return System

Initialize() protected method

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.
protected Initialize ( ) : void
return void

LoadContent() protected method

LoadContent will be called once per game and is the place to load all of your content.
protected LoadContent ( ) : void
return void

Update() protected method

Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio.
protected Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
return void

Property Details

ContentPackData public_oe static_oe property

public static ContentPack,Bricklayer.Client ContentPackData
return Bricklayer.Client.ContentPack

ContentPackIndex public_oe static_oe property

public static int ContentPackIndex
return int

ContentPackName public_oe static_oe property

public static string ContentPackName
return string

CurrentGameState public_oe static_oe property

public static GameState CurrentGameState
return GameState

DefaultFont public_oe static_oe property

public static SpriteFont,Microsoft.Xna.Framework.Graphics DefaultFont
return Microsoft.Xna.Framework.Graphics.SpriteFont

Host public_oe static_oe property

public static string Host
return string

Input public_oe static_oe property

public static InputHandler,Bricklayer.Client Input
return InputHandler

IsMouseOnControl public_oe static_oe property

public static bool IsMouseOnControl
return bool

MainWindow public_oe static_oe property

public static MainWindow,Bricklayer.Client.Interface MainWindow
return Bricklayer.Client.Interface.MainWindow

Map public_oe static_oe property

public static Map,Bricklayer.Client.World Map
return Bricklayer.Client.World.Map

MsgHandler public_oe static_oe property

public static MessageHandler,Bricklayer.Client.Networking MsgHandler
return Bricklayer.Client.Networking.MessageHandler

MyColor public_oe static_oe property

public static Color MyColor
return Color

MyHue public_oe static_oe property

public static int MyHue
return int

MyID public_oe static_oe property

public static byte MyID
return byte

MyIndex public_oe static_oe property

public static byte MyIndex
return byte

NetManager public_oe static_oe property

public static NetworkManager,Bricklayer.Client.Networking NetManager
return Bricklayer.Client.Networking.NetworkManager

Port public_oe static_oe property

public static int Port
return int

Random public_oe static_oe property

public static Random,System Random
return System.Random

Resolution public_oe static_oe property

public static Rectangle,Microsoft.Xna.Framework Resolution
return Microsoft.Xna.Framework.Rectangle

TextureLoader public_oe static_oe property

public static TextureLoader,Bricklayer.Client TextureLoader
return Bricklayer.Client.TextureLoader

Username public_oe static_oe property

public static string Username
return string