C# Class MoodSwingGame.MSMap

Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
Show file Open project: verngutz/MoodSwing Class Usage Examples

Public Properties

Property Type Description
floorheight int
hallheight int
shortheight int
tallheight int
tileDimension int

Public Methods

Method Description
CalculateRay ( Vector2 mouseLocation, Matrix view, Matrix projection, Viewport viewport ) : Microsoft.Xna.Framework.Ray

Calculates the ray formed from the mouse to the world space.

Draw ( GameTime gameTime ) : void
GetNearestVolunteerCenter ( MS3DTile reference ) : MSVolunteerCenter

Gets the nearest volunteer center with respect to a specific tile.

GetNearestVolunteerCenter ( Vector2 coord ) : MSVolunteerCenter
GetPath ( Vector2 start, Vector2 end ) : Node

Gets the head of the linked-list representing the shortest path from start to end in the map coordinate system.

GetRandomCitizenSource ( ) : MSUnchangeableBuilding
Intersects ( Microsoft.Xna.Framework.BoundingBox box, Vector2 mouseLocation, Matrix view, Matrix projection, Viewport viewport ) : float?

Checks whether the mouse intersects the bounding box of an object.

MSMap ( String filename ) : System
PickFrom3DWorld ( ) : MS3DTile

Picking Algo. Looks for the closest object that intersects the mouse ray

Update ( GameTime gameTime ) : void
load ( StreamReader sr ) : void
toString ( ) : String

Method Details

CalculateRay() public method

Calculates the ray formed from the mouse to the world space.
public CalculateRay ( Vector2 mouseLocation, Matrix view, Matrix projection, Viewport viewport ) : Microsoft.Xna.Framework.Ray
mouseLocation Vector2 Vector2D corresponding to the coordinate of the mouse on the screen.
view Matrix View matrix used
projection Matrix Projection matrix used
viewport Microsoft.Xna.Framework.Graphics.Viewport Viewport of the game
return Microsoft.Xna.Framework.Ray

Draw() public method

public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

GetNearestVolunteerCenter() public method

Gets the nearest volunteer center with respect to a specific tile.
public GetNearestVolunteerCenter ( MS3DTile reference ) : MSVolunteerCenter
reference MS3DTile Tile used as a reference point to find the nearest volunteer center
return MSVolunteerCenter

GetNearestVolunteerCenter() public method

public GetNearestVolunteerCenter ( Vector2 coord ) : MSVolunteerCenter
coord Vector2
return MSVolunteerCenter

GetPath() public method

Gets the head of the linked-list representing the shortest path from start to end in the map coordinate system.
public GetPath ( Vector2 start, Vector2 end ) : Node
start Vector2 The start tile coordinate.
end Vector2 The end tile coordinate.
return Node

GetRandomCitizenSource() public method

public GetRandomCitizenSource ( ) : MSUnchangeableBuilding
return MSUnchangeableBuilding

Intersects() public method

Checks whether the mouse intersects the bounding box of an object.
public Intersects ( Microsoft.Xna.Framework.BoundingBox box, Vector2 mouseLocation, Matrix view, Matrix projection, Viewport viewport ) : float?
box Microsoft.Xna.Framework.BoundingBox Bounding box of the object to check for intersection.
mouseLocation Vector2 Vector2D corresponding to the coordinate of the mouse on the screen.
view Matrix View matrix used
projection Matrix Projection matrix used
viewport Microsoft.Xna.Framework.Graphics.Viewport Viewport of the game
return float?

MSMap() public method

public MSMap ( String filename ) : System
filename String
return System

PickFrom3DWorld() public method

Picking Algo. Looks for the closest object that intersects the mouse ray
public PickFrom3DWorld ( ) : MS3DTile
return MS3DTile

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

load() public method

public load ( StreamReader sr ) : void
sr System.IO.StreamReader
return void

toString() public method

public toString ( ) : String
return String

Property Details

floorheight public static property

public static int floorheight
return int

hallheight public static property

public static int hallheight
return int

shortheight public static property

public static int shortheight
return int

tallheight public static property

public static int tallheight
return int

tileDimension public static property

public static int tileDimension
return int