Blueprints & Resources

Added the ability to associate simple commodities with resource maps
Added resource placement to zone generator
Added crafting blueprints and stat addressing system
Refactored Thrusters and Shields into Behaviors
Fixed server losing database connection
Updated icons
This commit is contained in:
hyperion51 2020-04-09 07:48:45 +01:00
commit fd92c80876
58 changed files with 1399 additions and 855 deletions

View file

@ -27,7 +27,9 @@ public class Ship : DatabaseEntry
[IgnoreMember] public float Temperature;
[IgnoreMember] public float Charge;
// [IgnoreMember] public Targetable Target;
[IgnoreMember] public float2 Position;
[IgnoreMember] public float2 Direction;
[IgnoreMember] public float2 Velocity;
[IgnoreMember] public Dictionary<object, float> VisibilitySources = new Dictionary<object, float>();
private HullData _hullData;
@ -51,6 +53,20 @@ public class Ship : DatabaseEntry
return null;
}
public IEnumerable<T> GetBehaviors<T>() where T : class, IItemBehavior
{
foreach (var behavior in ItemBehaviors)
if (behavior is T b)
yield return b;
}
public IEnumerable<T> GetBehaviorData<T>() where T : class, IItemBehaviorData
{
foreach (var behavior in ItemBehaviors)
if (behavior.Data is T b)
yield return b;
}
public void AddHeat(float heat)
{
Temperature += heat / SpecificHeat;
@ -192,4 +208,5 @@ public class Ship : DatabaseEntry
// }
//
// }
}
}