Merge remote-tracking branch 'origin/18-06-09-gridentities'
This commit is contained in:
@@ -111,21 +111,15 @@ namespace Content.Server
|
||||
{
|
||||
case ServerRunLevel.PreGame:
|
||||
var timing = IoCManager.Resolve<IGameTiming>();
|
||||
|
||||
var mainMap = new MapId(1);
|
||||
var mainGrid = new GridId(1);
|
||||
|
||||
IoCManager.Resolve<IPlayerManager>().FallbackSpawnPoint = new LocalCoordinates(0, 0, mainGrid, mainMap);
|
||||
|
||||
var mapLoader = IoCManager.Resolve<IMapLoader>();
|
||||
var mapMan = IoCManager.Resolve<IMapManager>();
|
||||
|
||||
var startTime = timing.RealTime;
|
||||
{
|
||||
var newMap = mapMan.CreateMap(mainMap);
|
||||
var newMap = mapMan.CreateMap();
|
||||
var grid = mapLoader.LoadBlueprint(newMap, "Maps/stationstation.yml");
|
||||
|
||||
mapLoader.LoadBlueprint(newMap, mainGrid, "Maps/stationstation.yml");
|
||||
}
|
||||
IoCManager.Resolve<IPlayerManager>().FallbackSpawnPoint = new GridLocalCoordinates(Vector2.Zero, grid);
|
||||
|
||||
var startTime = timing.RealTime;
|
||||
var timeSpan = timing.RealTime - startTime;
|
||||
Logger.Info($"Loaded map in {timeSpan.TotalMilliseconds:N2}ms.");
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
{
|
||||
public class PowerDebugTool : SharedPowerDebugTool, IAfterAttack
|
||||
{
|
||||
void IAfterAttack.Afterattack(IEntity user, LocalCoordinates clicklocation, IEntity attacked)
|
||||
void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked)
|
||||
{
|
||||
if (attacked == null)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
|
||||
}
|
||||
|
||||
void IAfterAttack.Afterattack(IEntity user, LocalCoordinates clicklocation, IEntity attacked)
|
||||
void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked)
|
||||
{
|
||||
var location = user.GetComponent<TransformComponent>().LocalPosition;
|
||||
var angle = new Angle(clicklocation.ToWorld().Position - location.ToWorld().Position);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
|
||||
|
||||
string spritename = "Objects/laser.png";
|
||||
|
||||
protected override void Fire(IEntity user, LocalCoordinates clicklocation)
|
||||
protected override void Fire(IEntity user, GridLocalCoordinates clicklocation)
|
||||
{
|
||||
var userposition = user.GetComponent<TransformComponent>().WorldPosition; //Remember world positions are ephemeral and can only be used instantaneously
|
||||
var angle = new Angle(clicklocation.Position - userposition);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
|
||||
|
||||
private float _velocity = 20f;
|
||||
|
||||
protected override void Fire(IEntity user, LocalCoordinates clicklocation)
|
||||
protected override void Fire(IEntity user, GridLocalCoordinates clicklocation)
|
||||
{
|
||||
var userposition = user.GetComponent<TransformComponent>().LocalPosition; //Remember world positions are ephemeral and can only be used instantaneously
|
||||
var angle = new Angle(clicklocation.Position - userposition.Position);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
|
||||
{
|
||||
public override string Name => "RangedWeapon";
|
||||
|
||||
void IAfterAttack.Afterattack(IEntity user, LocalCoordinates clicklocation, IEntity attacked)
|
||||
void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked)
|
||||
{
|
||||
if (UserCanFire(user) && WeaponCanFire())
|
||||
{
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
|
||||
return true;
|
||||
}
|
||||
|
||||
protected virtual void Fire(IEntity user, LocalCoordinates clicklocation)
|
||||
protected virtual void Fire(IEntity user, GridLocalCoordinates clicklocation)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="attackwith"></param>
|
||||
/// <param name="clicklocation"></param>
|
||||
/// <returns></returns>
|
||||
bool RangedAttackby(IEntity user, IEntity attackwith, LocalCoordinates clicklocation);
|
||||
bool RangedAttackby(IEntity user, IEntity attackwith, GridLocalCoordinates clicklocation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -66,7 +66,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="clicklocation"></param>
|
||||
/// <param name="attacked">The entity that was clicked on out of range. May be null if no entity was clicked on.true</param>
|
||||
void Afterattack(IEntity user, LocalCoordinates clicklocation, IEntity attacked);
|
||||
void Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -193,7 +193,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="weapon"></param>
|
||||
/// <param name="clicklocation"></param>
|
||||
public static void InteractAfterattack(IEntity user, IEntity weapon, LocalCoordinates clicklocation)
|
||||
public static void InteractAfterattack(IEntity user, IEntity weapon, GridLocalCoordinates clicklocation)
|
||||
{
|
||||
List<IAfterAttack> afterattacks = weapon.GetAllComponents<IAfterAttack>().ToList();
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="weapon"></param>
|
||||
/// <param name="attacked"></param>
|
||||
public static void Interaction(IEntity user, IEntity weapon, IEntity attacked, LocalCoordinates clicklocation)
|
||||
public static void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridLocalCoordinates clicklocation)
|
||||
{
|
||||
List<IAttackby> interactables = attacked.GetAllComponents<IAttackby>().ToList();
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="weapon"></param>
|
||||
/// <param name="attacked"></param>
|
||||
public static void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, LocalCoordinates clicklocation)
|
||||
public static void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridLocalCoordinates clicklocation)
|
||||
{
|
||||
List<IRangedAttackby> rangedusables = attacked.GetAllComponents<IRangedAttackby>().ToList();
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ namespace Content.Server.Placement
|
||||
{
|
||||
var entMan = IoCManager.Resolve<IServerEntityManager>();
|
||||
var tBase = entMan.SpawnEntity("TurretBase");
|
||||
tBase.GetComponent<IServerTransformComponent>().LocalPosition = new LocalCoordinates(localPosition, grid);
|
||||
tBase.GetComponent<IServerTransformComponent>().LocalPosition = new GridLocalCoordinates(localPosition, grid);
|
||||
|
||||
var tTop = entMan.SpawnEntity("TurretTopLight");
|
||||
tTop.GetComponent<IServerTransformComponent>().LocalPosition = new LocalCoordinates(localPosition, grid);
|
||||
tTop.GetComponent<IServerTransformComponent>().LocalPosition = new GridLocalCoordinates(localPosition, grid);
|
||||
tTop.GetComponent<IServerTransformComponent>().AttachParent(tBase);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user