ManiaMap.Unity
Procedural generation of metroidvania style maps for Unity.
CollectableSpotComponent Class Reference

Represents a collectable spot. More...

Inheritance diagram for CollectableSpotComponent:
CellChild

Public Member Functions

bool Acquire ()
 If the collectable spot exists and has not already been acquired, adds it to the current layout state's acquired collectables and marks it as acquired. Returns true if this action is performed. More...
 
override void AutoAssign (RoomComponent room)
 Auto assigns elements to the collectable spot. More...
 
bool CanAcquire ()
 Returns true if the collectable can be acquired. More...
 
bool CollectableExists ()
 True if the collectable spot exists. More...
 
int CollectableId ()
 The collectable ID. If the collectable spot does not exist in the layout, returns -1. More...
 
CollectableSpot GetMMCollectableSpot ()
 Returns new generation data for the collectable spot. More...
 
bool IsAcquired ()
 True if the collectable spot is already acquired. More...
 

Properties

bool EditId [getset]
 If true, the ID can be edited in the inspector. More...
 
CollectableGroup Group [getset]
 The collectable group. More...
 
int Id [getset]
 The unique location ID, relative to the cell. More...
 
float Weight [getset]
 The manual draw weight of the collectable spot. More...
 
- Properties inherited from CellChild
bool AutoAssignCell [getset]
 If true, the cell will be automatically assigned to the closest cell when update and save operations are performed. More...
 
Vector2Int CellIndex [getset]
 The containing cell index. More...
 
int Column [getset]
 The column index. More...
 
bool IsInitialized [getprotected set]
 True if the object has been initialized. More...
 
UnityEvent OnInitialize [getset]
 The event invoked after the object is initialized. More...
 
RoomComponent Room [getset]
 The containing room. More...
 
int Row [getset]
 The row index. More...
 

Private Member Functions

void OnValidate ()
 

Private Attributes

bool _editId
 
CollectableGroup _group
 
int _id = -1
 
float _weight = 1
 

Additional Inherited Members

- Protected Member Functions inherited from CellChild
virtual void Awake ()
 
virtual void Initialize ()
 Initializes the object. More...
 
virtual void OnDestroy ()
 
- Protected Attributes inherited from CellChild
bool _autoAssignCell = true
 
Vector2Int _cellIndex
 
RoomComponent _room
 

Detailed Description

Represents a collectable spot.

Definition at line 10 of file CollectableSpotComponent.cs.

Member Function Documentation

◆ Acquire()

bool Acquire ( )

If the collectable spot exists and has not already been acquired, adds it to the current layout state's acquired collectables and marks it as acquired. Returns true if this action is performed.

Definition at line 85 of file CollectableSpotComponent.cs.

◆ AutoAssign()

override void AutoAssign ( RoomComponent  room)
virtual

Auto assigns elements to the collectable spot.

Reimplemented from CellChild.

Definition at line 96 of file CollectableSpotComponent.cs.

◆ CanAcquire()

bool CanAcquire ( )

Returns true if the collectable can be acquired.

Definition at line 75 of file CollectableSpotComponent.cs.

◆ CollectableExists()

bool CollectableExists ( )

True if the collectable spot exists.

Definition at line 59 of file CollectableSpotComponent.cs.

◆ CollectableId()

int CollectableId ( )

The collectable ID. If the collectable spot does not exist in the layout, returns -1.

Definition at line 48 of file CollectableSpotComponent.cs.

◆ GetMMCollectableSpot()

CollectableSpot GetMMCollectableSpot ( )

Returns new generation data for the collectable spot.

Definition at line 105 of file CollectableSpotComponent.cs.

◆ IsAcquired()

bool IsAcquired ( )

True if the collectable spot is already acquired.

Definition at line 67 of file CollectableSpotComponent.cs.

◆ OnValidate()

void OnValidate ( )
private

Definition at line 40 of file CollectableSpotComponent.cs.

Member Data Documentation

◆ _editId

bool _editId
private

Definition at line 13 of file CollectableSpotComponent.cs.

◆ _group

CollectableGroup _group
private

Definition at line 27 of file CollectableSpotComponent.cs.

◆ _id

int _id = -1
private

Definition at line 20 of file CollectableSpotComponent.cs.

◆ _weight

float _weight = 1
private

Definition at line 34 of file CollectableSpotComponent.cs.

Property Documentation

◆ EditId

bool EditId
getset

If true, the ID can be edited in the inspector.

Definition at line 17 of file CollectableSpotComponent.cs.

◆ Group

CollectableGroup Group
getset

The collectable group.

Definition at line 31 of file CollectableSpotComponent.cs.

◆ Id

int Id
getset

The unique location ID, relative to the cell.

Definition at line 24 of file CollectableSpotComponent.cs.

◆ Weight

float Weight
getset

The manual draw weight of the collectable spot.

Definition at line 38 of file CollectableSpotComponent.cs.


The documentation for this class was generated from the following file: