Interface IObjectInfo
Interface implemented by objects so that they can be selected and modified through the UI.
Namespace: AS2.Visuals
Assembly: .dll
Syntax
public interface IObjectInfo
Properties
| Edit this page View SourceColor
The object's color.
Declaration
Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color |
Identifier
The object's identifier. Does not have to be unique among all objects.
Declaration
int Identifier { get; set; }
Property Value
Type | Description |
---|---|
int |
Position
Declaration
Vector2Int Position { get; }
Property Value
Type | Description |
---|---|
Vector2Int |
Size
The number of nodes occupied by the object.
Declaration
int Size { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceAddPosition(Vector2Int)
Adds the given global grid position to the object. Ideally, the position should be adjacent to the object. Disconnected objects will prevent the simulation from being started.
Declaration
void AddPosition(Vector2Int pos)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | pos | The global grid position to be added. |
IsAnchor()
Checks whether this object is currently the anchor.
Declaration
bool IsAnchor()
Returns
Type | Description |
---|---|
bool |
|
IsConnected(Vector2Int)
Checks whether the object occupies a connected set of grid nodes if the given node is removed.
Declaration
bool IsConnected(Vector2Int removePosition)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | removePosition | The global grid position that should be removed from the object. This position is not considered as occupied in the connectivity check. |
Returns
Type | Description |
---|---|
bool |
|
IsNeighborPosition(Vector2Int)
Checks whether the given global grid position is adjacent to the object.
Declaration
bool IsNeighborPosition(Vector2Int pos)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | pos | The global grid position to check. |
Returns
Type | Description |
---|---|
bool |
|
MakeAnchor()
Turns this object into the anchor of the system.
Declaration
void MakeAnchor()
MoveToPosition(Vector2Int)
Moves the object to the given global coordinates.
Declaration
bool MoveToPosition(Vector2Int newPos)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | newPos | The global grid coordinates to which the object should be moved. |
Returns
Type | Description |
---|---|
bool |
|
OccupiedPositions()
Computes the set of grid nodes occupied by the object.
Declaration
ICollection<Vector2Int> OccupiedPositions()
Returns
Type | Description |
---|---|
ICollection<Vector2Int> | The global coordinates of all grid nodes occupied by the object. |
RemoveFromSystem()
Removes the object from the particle system and the render system.
Declaration
void RemoveFromSystem()
RemovePosition(Vector2Int)
Removes the given global grid position from the object, if the object remains connected and non-empty.
Note that the object's origin position will change if the node at the origin is removed.
Declaration
bool RemovePosition(Vector2Int pos)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | pos | The global grid position to be removed. |
Returns
Type | Description |
---|---|
bool |
|