Class Scene
Create and manipulate Scenes.
Inheritance
Namespace: Mannequin.Bindings
Assembly: Collapse.dll
Syntax
public class Scene : object
Constructors
Scene(SceneOptions)
Create a Scene using the settings in SceneOpts.
Declaration
public Scene(SceneOptions opts)
Parameters
Type | Name | Description |
---|---|---|
SceneOptions | opts | Options for this Scene |
Scene(SceneOptions, Closure)
Create a Scene with a Lua-based generator
Declaration
public Scene(SceneOptions opts, Closure generator)
Parameters
Type | Name | Description |
---|---|---|
SceneOptions | opts | The initial options for generating this scene |
Closure | generator | A Lua closure that is passed the X position, the Y position of the current target, and a reference to the newly-created Scene. It expects a Tile in return |
Properties
Group
Get the SceneGroup that this Scene belongs to.
Declaration
public SceneGroup Group { get; }
Property Value
Type | Description |
---|---|
SceneGroup |
Height
The height of the Scene.
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsGameScene
Whether this is a game scene or not. Game scenes have zones and are generally part of scene groups, as opposed to world map scenes.
Declaration
public bool IsGameScene { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
The name of this Scene.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Width
The width of the Scene.
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
AddZone(Zone)
Add a Zone to this Scene.
Declaration
public void AddZone(Zone zone)
Parameters
Type | Name | Description |
---|---|---|
Zone | zone | The Zone to add. |
GetAgents()
Get all of the Agents in this scene.
Declaration
public List<Agent> GetAgents()
Returns
Type | Description |
---|---|
List<Agent> | All of the Agents in this scene. |
GetTile(Point)
Get a tile from a Scene.
Declaration
public Tile GetTile(Point p)
Parameters
Type | Name | Description |
---|---|---|
Point | p | Point on the map |
Returns
Type | Description |
---|---|
Tile | The Tile at that position |
GetTile(Int32, Int32)
Get a tile from a Scene.
Consider using GetTile(Point) instead.
Declaration
public Tile GetTile(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X position |
System.Int32 | y | Y position |
Returns
Type | Description |
---|---|
Tile | The Tile at that position |
GetZones()
Get all of the Zones in this Scene.
Declaration
public List<Zone> GetZones()
Returns
Type | Description |
---|---|
List<Zone> | All of the Zones in this Scene. |
Kill()
Kill and dispose of this Scene. Will return to the main menu if there are no other Scenes.
Declaration
public void Kill()
SetActive()
Mark this Scene as the active Scene, i.e. the one the player is playing on
Declaration
public void SetActive()
SetTile(Point, Tile)
Set a tile in a Scene.
Declaration
public void SetTile(Point p, Tile t)
Parameters
Type | Name | Description |
---|---|---|
Point | p | Point on the map grid |
Tile | t | Tile to place |
SetTile(Int32, Int32, Tile)
Declaration
public void SetTile(int x, int y, Tile t)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X position on the grid |
System.Int32 | y | Y position on the grid |
Tile | t | Tile to place |
UpdateTiles()
Update this Scene's tiles. Must be called or any changes won't show.
Declaration
public void UpdateTiles()