Lots of nonsense

This commit is contained in:
riedel 2023-05-08 17:02:19 +02:00
parent 9584420f6c
commit bd93ae2f5f
19 changed files with 334 additions and 178 deletions

View file

@ -0,0 +1,48 @@
using CityGame.Classes.Rendering;
using CityGame.Classes.World;
namespace CityGame.Classes.Entities
{
public abstract class Entity : ISelectable
{
public float X { get; set; }
public float Y { get; set; }
public float Rotation { get; set; }
public long Time { get; set; }
public OCanvas Object { get; set; }
public OCanvas GetImage()
{
return Object;
}
public abstract OCanvas Render();
public bool RunAction(ISelectable target)
{
if (this is Helicopter heli)
{
heli.Target = target;
return true;
}
if(this is PoliceCar car)
{
car.Path = null;
car.Target = target;
}
return false;
}
public abstract void Tick(long deltaTime);
int ISelectable.X()
{
return (int)X;
}
int ISelectable.Y()
{
return (int)Y;
}
}
}