Example #1
0
 public void DropItem(SystemComponent item)
 {
     if (!items.Remove(item))
     {
         throw new Exception("Inventory does not contain item");
     }
 }
Example #2
0
 public static SystemLink Pack(SystemComponent component)
 {
     if (component is PowerComponent)
     {
         return(new PowerLink((PowerComponent)component));
     }
     else
     {
         return(new SystemLink(component));
     }
 }
Example #3
0
        public void SetComponent(SystemComponent component, ComponentActivity[] activities, Action disabledEvent, Action enabledEvent)
        {
            this.component     = component;
            this.activities    = activities;
            this.disabledEvent = disabledEvent;
            this.enabledEvent  = enabledEvent;

            foreach (var a in this.activities)
            {
                a.SetConnector(this);
            }
        }
Example #4
0
 public SystemLink(SystemComponent component)
 {
     item      = component;
     maxHealth = new float[] { 1, 2, 5, 10, 20 }[component.shipClass];
     _health   = maxHealth;
 }
Example #5
0
 public void AddItem(SystemComponent item)
 {
     items.Add(item);
 }