Example #1
0
 /// <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);
 }
Example #2
0
 /// <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;
     }
 }
Example #3
0
 protected bool Equals(BaseComponent other)
 {
     return string.Equals(PermanentDesignation, other.PermanentDesignation);
 }
Example #4
0
 /// <summary>
 /// Removes the component from active play and places it back in its pile
 /// </summary>
 /// <param name="ship"></param>
 public void DiscardComponent(BaseComponent ship)
 { }
Example #5
0
 /// <summary>
 /// Marks the component as destroyed and changes the GameState accordingly.
 /// </summary>
 /// <param name="ship"></param>
 public void DestroyComponent(BaseComponent ship)
 { 
 }
Example #6
0
 public void RemoveComponent(BaseComponent component)
 {
     CurrentGameState.Dradis.RemoveComponent(component.PermanentDesignation);
 }
Example #7
0
 protected bool Equals(BaseComponent other)
 {
     return(string.Equals(PermanentDesignation, other.PermanentDesignation));
 }