Lots of nonsense
This commit is contained in:
parent
9584420f6c
commit
bd93ae2f5f
19 changed files with 334 additions and 178 deletions
48
CityGame/Classes/Entities/Entity.cs
Normal file
48
CityGame/Classes/Entities/Entity.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue