промежуточная фиксация 1.1
This commit is contained in:
parent
c0bbc3a118
commit
5ec3ff18fb
@ -39,6 +39,34 @@ namespace Bus
|
||||
public string GetInfo() => _bus?.GetDataForSave();
|
||||
|
||||
public static IDrawingObject Create(string data) => new DrawingObjectBus(data.CreateDrawingBus());
|
||||
|
||||
|
||||
public bool Equals(IDrawingObject? other)
|
||||
{
|
||||
if (other == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var otherBus = other as DrawingObjectBus;
|
||||
if (otherBus == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var bus = _bus.Bus;
|
||||
var otherBusBus = otherBus._bus.Bus;
|
||||
if (bus.Speed != otherBusBus.Speed)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (bus.Weight != otherBusBus.Weight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (bus.BodyColor != otherBusBus.BodyColor)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// TODO доделать проверки в случае продвинутого объекта
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Bus
|
||||
{
|
||||
internal interface IDrawingObject
|
||||
internal interface IDrawingObject : IEquatable<IDrawingObject>
|
||||
{
|
||||
public float Step { get; }
|
||||
void SetObject(int x, int y, int width, int height);
|
||||
|
Loading…
Reference in New Issue
Block a user