using System;
using Framework.Services;
namespace Framework.Selection {
/// Makes a game object selectable
/// >
/// The selection system provides a reusable way to select and query selected
/// objects for an actor. Any game object with a component
/// on it can be selected or highlighted by the selector components the game uses.
///
public class Selectable : ScriptComponent, ISelectable {
/// Whether the game object can be selected
public bool CanBeHighlighted = true;
/// Whether the game object can be added to an actor's selection
public bool CanBeSelected = true;
/// Whether the object is currently highlighted
public bool IsHighlighted {
get { return this.isHighlighted; }
set {
if(!this.CanBeHighlighted) {
return;
}
this.isHighlighted = value;
}
}
/// Whether the object is currently selected
public bool IsSelected {
get { return this.isSelected; }
set {
if(!this.CanBeSelected) {
return;
}
this.isSelected = value;
}
}
/// Whether the object is currently in a state that allows highlighting
bool ISelectable.CanBeHighlighted {
get { return this.CanBeHighlighted; }
}
/// Whether the object is currently in a state that allows selection
bool ISelectable.CanBeSelected {
get { return this.CanBeSelected; }
}
/// Whether the game object is currently highlighted
private bool isHighlighted;
/// Whether the game object is currently selected
private bool isSelected;
}
} // namespace Framework.Selection