public void Add(Vector2 hardPoint, HardPointType type) { string dataAsset = type == HardPointType.Engine ? "Sprites\\UI\\InGameUI\\EngineHardPointUI" : "Sprites\\UI\\InGameUI\\HardPointUI"; HardPointUI hardPointUI = new HardPointUI(Parent, hardPoint, dataAsset); if (type == HardPointType.Engine) { EngineHardPointUI.Add(hardPointUI); } else { OtherHardPointUI.Add(hardPointUI); } }
public void Initialize(ShipData shipData) { foreach (Vector2 otherHardPoint in shipData.OtherHardPoints) { HardPointUI hardPointUI = new HardPointUI(Parent, otherHardPoint); hardPointUI.LoadContent(); hardPointUI.Initialize(); OtherHardPointUI.Add(hardPointUI); } foreach (Vector2 engineHardPoint in shipData.EngineHardPoints) { HardPointUI hardPointUI = new HardPointUI(Parent, engineHardPoint, "Sprites\\UI\\InGameUI\\EngineHardPointUI"); hardPointUI.LoadContent(); hardPointUI.Initialize(); EngineHardPointUI.Add(hardPointUI); } }