Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing redundant Entity class. #161

Merged
merged 2 commits into from
Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.