Skip to content

Commit

Permalink
Merge pull request #161 from rune-js/remove-entity
Browse files Browse the repository at this point in the history
Removing redundant Entity class.
  • Loading branch information
TheBlackParade authored Jun 6, 2020
2 parents 050ef07 + 59d54c7 commit 0755f80
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 30 deletions.
26 changes: 23 additions & 3 deletions src/world/actor/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { WalkingQueue } from './walking-queue';
import { ItemContainer } from '../items/item-container';
import { Animation, Graphic, UpdateFlags } from './update-flags';
import { Npc } from './npc/npc';
import { Entity } from '../entity';
import { Skills } from '@server/world/actor/skills';
import { Item } from '@server/world/items/item';
import { Position } from '@server/world/position';
Expand All @@ -12,8 +11,10 @@ import { CombatAction } from '@server/world/actor/player/action/combat-action';
/**
* Handles an actor within the game world.
*/
export abstract class Actor extends Entity {
export abstract class Actor {

private _position: Position;
private _lastMapRegionUpdatePosition: Position;
private _worldIndex: number;
public readonly updateFlags: UpdateFlags;
private readonly _walkingQueue: WalkingQueue;
Expand All @@ -27,7 +28,6 @@ export abstract class Actor extends Entity {
private _combatActions: CombatAction[];

protected constructor() {
super();
this.updateFlags = new UpdateFlags();
this._walkingQueue = new WalkingQueue(this);
this._walkDirection = -1;
Expand Down Expand Up @@ -213,6 +213,26 @@ export abstract class Actor extends Entity {

public abstract equals(actor: Actor): boolean;

public get position(): Position {
return this._position;
}

public set position(value: Position) {
if(!this._position) {
this._lastMapRegionUpdatePosition = value;
}

this._position = value;
}

public get lastMapRegionUpdatePosition(): Position {
return this._lastMapRegionUpdatePosition;
}

public set lastMapRegionUpdatePosition(value: Position) {
this._lastMapRegionUpdatePosition = value;
}

public get worldIndex(): number {
return this._worldIndex;
}
Expand Down
27 changes: 0 additions & 27 deletions src/world/entity.ts

This file was deleted.

0 comments on commit 0755f80

Please sign in to comment.