C# Class Portal2.Items.Item

Base class for all items.
Show file Open project: Kyle0654/Portal2.Puzzle

Protected Properties

Property Type Description
angles Point3
defaultNormal Direction
defaultRight Direction
deletable bool
facing Point3
localPosition FPoint3
owner Puzzle

Private Properties

Property Type Description
AddProperties void
CreateInstance Item
FinishReadProperties void
FromAngleProperty Point3
GetConnectionReceiver Portal2.Connections.ConnectionPointReceiver
GetConnectionSender ConnectionPointSender
GetNode P2CNode
PrepareGetNode void
ReadItem Item
ReadProperties void
ReadProperty void
RegisterConnection void
RegisterConnection void
ToAngleProperty Point3

Public Methods

Method Description
ToString ( ) : string

Protected Methods

Method Description
GetNormalFromWall ( Direction wall ) : Direction

Gets a normal from a specified wall.

GetWall ( ) : Direction

Gets the wall the item is currently on.

Item ( Puzzle owner ) : System

Private Methods

Method Description
AddProperties ( P2CNode node ) : void

Derived classes should add all non-default item properties to the node here.

CreateInstance ( Puzzle owner, string type ) : Item

Creates an item of the specified item type (or a generic item if the type wasn't recognized).

FinishReadProperties ( ) : void

Called when all properties have been read, so any initialization can happen.

FromAngleProperty ( Point3 prop ) : Point3

Read from YZX order to XYZ order.

GetConnectionReceiver ( string connectionType ) : ConnectionPointReceiver
GetConnectionSender ( ) : ConnectionPointSender
GetNode ( ) : P2CNode

Gets a P2CNode for saving.

PrepareGetNode ( ) : void

Derived classes can override this to prepare data before saving.

ReadItem ( Puzzle owner, P2CNode node ) : Item

Reads a P2CNode for an item.

ReadProperties ( P2CNode node, Item item ) : void

Reads the properties in the node into the item.

ReadProperty ( P2CProperty property ) : void

Reads a property that wasn't one of the default item properties.

RegisterConnection ( ConnectionPointReceiver receiver ) : void
RegisterConnection ( ConnectionPointSender sender ) : void
ToAngleProperty ( Point3 angles ) : Point3

Output in YZX order.

Method Details

GetNormalFromWall() protected static method

Gets a normal from a specified wall.
protected static GetNormalFromWall ( Direction wall ) : Direction
wall Direction
return Direction

GetWall() protected method

Gets the wall the item is currently on.
protected GetWall ( ) : Direction
return Direction

Item() protected method

protected Item ( Puzzle owner ) : System
owner Puzzle
return System

ToString() public method

public ToString ( ) : string
return string

Property Details

angles protected property

Rotations around axis, ordered by Y, Z, X, performed in X, Y, Z order.
protected Point3 angles
return Point3

defaultNormal protected property

protected Direction defaultNormal
return Direction

defaultRight protected property

protected Direction defaultRight
return Direction

deletable protected property

protected bool deletable
return bool

facing protected property

protected Point3 facing
return Point3

localPosition protected property

protected FPoint3 localPosition
return FPoint3

owner protected property

protected Puzzle owner
return Puzzle