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