Skip to content

Commit 0755f80

Browse files
Merge pull request #161 from rune-js/remove-entity
Removing redundant Entity class.
2 parents 050ef07 + 59d54c7 commit 0755f80

File tree

2 files changed

+23
-30
lines changed

2 files changed

+23
-30
lines changed

src/world/actor/actor.ts

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { WalkingQueue } from './walking-queue';
22
import { ItemContainer } from '../items/item-container';
33
import { Animation, Graphic, UpdateFlags } from './update-flags';
44
import { Npc } from './npc/npc';
5-
import { Entity } from '../entity';
65
import { Skills } from '@server/world/actor/skills';
76
import { Item } from '@server/world/items/item';
87
import { Position } from '@server/world/position';
@@ -12,8 +11,10 @@ import { CombatAction } from '@server/world/actor/player/action/combat-action';
1211
/**
1312
* Handles an actor within the game world.
1413
*/
15-
export abstract class Actor extends Entity {
14+
export abstract class Actor {
1615

16+
private _position: Position;
17+
private _lastMapRegionUpdatePosition: Position;
1718
private _worldIndex: number;
1819
public readonly updateFlags: UpdateFlags;
1920
private readonly _walkingQueue: WalkingQueue;
@@ -27,7 +28,6 @@ export abstract class Actor extends Entity {
2728
private _combatActions: CombatAction[];
2829

2930
protected constructor() {
30-
super();
3131
this.updateFlags = new UpdateFlags();
3232
this._walkingQueue = new WalkingQueue(this);
3333
this._walkDirection = -1;
@@ -213,6 +213,26 @@ export abstract class Actor extends Entity {
213213

214214
public abstract equals(actor: Actor): boolean;
215215

216+
public get position(): Position {
217+
return this._position;
218+
}
219+
220+
public set position(value: Position) {
221+
if(!this._position) {
222+
this._lastMapRegionUpdatePosition = value;
223+
}
224+
225+
this._position = value;
226+
}
227+
228+
public get lastMapRegionUpdatePosition(): Position {
229+
return this._lastMapRegionUpdatePosition;
230+
}
231+
232+
public set lastMapRegionUpdatePosition(value: Position) {
233+
this._lastMapRegionUpdatePosition = value;
234+
}
235+
216236
public get worldIndex(): number {
217237
return this._worldIndex;
218238
}

src/world/entity.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)