5 min
This commit is contained in:
parent
d78e351907
commit
d628bda63b
@ -38,5 +38,32 @@ namespace GasolineTanker
|
|||||||
}
|
}
|
||||||
public string GetInfo() => _gasolineTanker?.GetDataForSave();
|
public string GetInfo() => _gasolineTanker?.GetDataForSave();
|
||||||
public static IDrawingObject Create(string data) => new DrawingObjectGasolineTanker(data.CreateDrawingGasolineTanker());
|
public static IDrawingObject Create(string data) => new DrawingObjectGasolineTanker(data.CreateDrawingGasolineTanker());
|
||||||
|
|
||||||
|
public bool Equals(IDrawingObject? other)
|
||||||
|
{
|
||||||
|
if (other is not DrawingObjectGasolineTanker otherGasolineTanker)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var entity = ;
|
||||||
|
var otherEntity = otherGasolineTanker.;
|
||||||
|
if (entity.GetType() != otherEntity.GetType() ||
|
||||||
|
entity.Speed != otherEntity.Speed ||
|
||||||
|
entity.Weight != otherEntity.Weight ||
|
||||||
|
entity.BodyColor != otherEntity.BodyColor)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (entity is EntityImprovedGasolineTanker entityImprovedGasolineTanker &&
|
||||||
|
otherEntity is EntityImprovedGasolineTanker otherEntityWarmlyShip && (
|
||||||
|
entityImprovedGasolineTanker.BodyColor != otherEntityWarmlyShip.BodyColor ||
|
||||||
|
entityImprovedGasolineTanker.DopColor != otherEntityWarmlyShip.DopColor ||
|
||||||
|
entityImprovedGasolineTanker.BodyKit != otherEntityWarmlyShip.BodyKit))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace GasolineTanker
|
namespace GasolineTanker
|
||||||
{
|
{
|
||||||
internal interface IDrawingObject
|
internal interface IDrawingObject : IEquatable<IDrawingObject>
|
||||||
{
|
{
|
||||||
public float Step { get; }
|
public float Step { get; }
|
||||||
void SetObject(int x, int y, int width, int height);
|
void SetObject(int x, int y, int width, int height);
|
||||||
|
Loading…
Reference in New Issue
Block a user