예제 #1
0
 public void DropItem(SystemComponent item)
 {
     if (!items.Remove(item))
     {
         throw new Exception("Inventory does not contain item");
     }
 }
예제 #2
0
 public static SystemLink Pack(SystemComponent component)
 {
     if (component is PowerComponent)
     {
         return(new PowerLink((PowerComponent)component));
     }
     else
     {
         return(new SystemLink(component));
     }
 }
예제 #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);
            }
        }
예제 #4
0
 public SystemLink(SystemComponent component)
 {
     item      = component;
     maxHealth = new float[] { 1, 2, 5, 10, 20 }[component.shipClass];
     _health   = maxHealth;
 }
예제 #5
0
 public void AddItem(SystemComponent item)
 {
     items.Add(item);
 }