31 lines
596 B
Dart
31 lines
596 B
Dart
import 'package:wolf_dart/classes/coordinate_2d.dart';
|
|
|
|
enum EntityState { staticObj, idle, patrolling, shooting, pain, dead }
|
|
|
|
abstract class Entity<T> {
|
|
double x;
|
|
double y;
|
|
int spriteIndex;
|
|
double angle;
|
|
EntityState state;
|
|
int mapId;
|
|
int lastActionTime;
|
|
|
|
Entity({
|
|
required this.x,
|
|
required this.y,
|
|
required this.spriteIndex,
|
|
this.angle = 0.0,
|
|
this.state = EntityState.staticObj,
|
|
this.mapId = 0,
|
|
this.lastActionTime = 0,
|
|
});
|
|
|
|
set position(Coordinate2D pos) {
|
|
x = pos.x;
|
|
y = pos.y;
|
|
}
|
|
|
|
Coordinate2D get position => Coordinate2D(x, y);
|
|
}
|