/// <summary> /// Adds the component to node. /// </summary> /// <param name="component">The component.</param> /// <param name="name">The name.</param> public void AddComponentToNode(BaseComponent component, DradisNodeName name) { if (component == null) return; if (Nodes == null) PrepDradis(); var sector = Nodes.FirstOrDefault(x => x.NodeName == name); if (sector == default(DradisNode)) { PrepDradis(); sector = Nodes.First(x => x.NodeName == name); } sector.Components.Add(component); }
/// <summary> /// Removes a component. /// </summary> /// <param name="component">The component.</param> public void RemoveComponent(BaseComponent component) { if (component == null) return; if (Nodes == null) PrepDradis(); var sector = Nodes.FirstOrDefault(x => x.Components.Contains(component)); if(sector == default(DradisNode)) { PrepDradis(); sector = Nodes.First(x => x.Components.Contains(component)); } sector.Components.Remove(component); if (component.ComponentType == Components.Enums.ComponentType.Viper) { ((Viper)component).Pilot = null; ((Viper)component).Status = Components.Enums.ComponentStatus.InReserve; } if (component.ComponentType == Components.Enums.ComponentType.Civilian) { ((Civilian)component).Status = Components.Enums.ComponentStatus.InReserve; } }
protected bool Equals(BaseComponent other) { return string.Equals(PermanentDesignation, other.PermanentDesignation); }
/// <summary> /// Removes the component from active play and places it back in its pile /// </summary> /// <param name="ship"></param> public void DiscardComponent(BaseComponent ship) { }
/// <summary> /// Marks the component as destroyed and changes the GameState accordingly. /// </summary> /// <param name="ship"></param> public void DestroyComponent(BaseComponent ship) { }
public void RemoveComponent(BaseComponent component) { CurrentGameState.Dradis.RemoveComponent(component.PermanentDesignation); }
protected bool Equals(BaseComponent other) { return(string.Equals(PermanentDesignation, other.PermanentDesignation)); }