chore: dead code

This commit is contained in:
cha0s 2019-09-30 15:19:10 -05:00
parent 12a70ee94e
commit 909cc388f2
12 changed files with 31 additions and 105 deletions

View File

@ -11,7 +11,6 @@ import {
import {SynchronizedMixin} from '@avocado/net'; import {SynchronizedMixin} from '@avocado/net';
import {Resource} from '@avocado/resource'; import {Resource} from '@avocado/resource';
import {EntityCreatePacket} from './packets/entity-create.packet';
import {hasTrait, lookupTrait} from './trait/registry'; import {hasTrait, lookupTrait} from './trait/registry';
import {EntityUpdateTraitPacket} from './packets/entity-update-trait.packet'; import {EntityUpdateTraitPacket} from './packets/entity-update-trait.packet';

View File

@ -1,9 +1,5 @@
export {Entity} from './entity.synchronized'; export {Entity} from './entity.synchronized';
export {EntityCreatePacket} from './packets/entity-create.packet';
export {EntityRemovePacket} from './packets/entity-remove.packet';
export {EntityPacket} from './packets/entity.packet';
export { export {
EntityListUpdateEntityPacket, EntityListUpdateEntityPacket,
} from './packets/entity-list-update-entity.packet'; } from './packets/entity-list-update-entity.packet';

View File

@ -1,33 +0,0 @@
import msgpack from 'msgpack-lite';
import {EntityPacket} from './entity.packet';
export class EntityCreatePacket extends EntityPacket {
constructor(data, entity) {
if ('undefined' !== typeof entity) {
data.layer = entity.layer.index;
}
super(data, entity);
}
static pack(packet) {
return this.builder.encode({
_id: packet.data[0],
data: msgpack.encode(packet.data[1]),
})
}
static get schema() {
return {
...super.schema,
data: 'buffer',
};
}
static unpack(packet) {
const {data} = this.builder.decode(packet);
return msgpack.decode(data);
}
}

View File

@ -1,3 +0,0 @@
import {EntityPacket} from './entity.packet';
export class EntityRemovePacket extends EntityPacket {}

View File

@ -1,22 +0,0 @@
import {Packet} from '@avocado/net';
export class EntityPacket extends Packet {
constructor(data, entity) {
if ('undefined' !== typeof entity) {
data.uuid = entity.numericUid;
}
super(data);
this.entity = entity;
}
static get schema() {
return {
...super.schema,
data: {
uuid: 'uint32',
},
};
}
}

View File

@ -1,12 +1,10 @@
import {EntityPacket} from '@avocado/entity'; // export class TraitAlivePacket extends EntityPacket {
export class TraitAlivePacket extends EntityPacket { // static get schema() {
// const schema = super.schema;
// schema.data.life = 'uint16';
// schema.data.maxLife = 'uint16';
// return schema;
// }
static get schema() { // }
const schema = super.schema;
schema.data.life = 'uint16';
schema.data.maxLife = 'uint16';
return schema;
}
}

View File

@ -1,11 +1,9 @@
import {EntityPacket} from './entity.packet'; // export class TraitDirectionalPacket extends EntityPacket {
export class TraitDirectionalPacket extends EntityPacket { // static get schema() {
// const schema = super.schema;
// schema.data.direction = 'uint8';
// return schema;
// }
static get schema() { // }
const schema = super.schema;
schema.data.direction = 'uint8';
return schema;
}
}

View File

@ -1,12 +1,10 @@
import {EntityPacket} from '@avocado/entity'; // export class TraitVisiblePacket extends EntityPacket {
export class TraitVisiblePacket extends EntityPacket { // static get schema() {
// const schema = super.schema;
// schema.data.isVisible = 'bool';
// schema.data.opacity = 'uint8';
// return schema;
// }
static get schema() { // }
const schema = super.schema;
schema.data.isVisible = 'bool';
schema.data.opacity = 'uint8';
return schema;
}
}

View File

@ -1,12 +1,10 @@
import {EntityPacket} from '@avocado/entity'; // export class TraitAnimatedPacket extends EntityPacket {
export class TraitAnimatedPacket extends EntityPacket { // static get schema() {
// const schema = super.schema;
// schema.data.currentAnimation = 'string';
// schema.data.isAnimating = 'bool';
// return schema;
// }
static get schema() { // }
const schema = super.schema;
schema.data.currentAnimation = 'string';
schema.data.isAnimating = 'bool';
return schema;
}
}

View File

@ -1,7 +1,6 @@
import {compose, EventEmitter, Property} from '@avocado/core'; import {compose, EventEmitter, Property} from '@avocado/core';
import { import {
Entity, Entity,
EntityCreatePacket,
EntityList, EntityList,
EntityListUpdateEntityPacket, EntityListUpdateEntityPacket,
} from '@avocado/entity'; } from '@avocado/entity';

View File

@ -1,7 +1,6 @@
import * as I from 'immutable'; import * as I from 'immutable';
import {arrayUnique, compose, EventEmitter, flatten} from '@avocado/core'; import {arrayUnique, compose, EventEmitter, flatten} from '@avocado/core';
import {EntityCreatePacket} from '@avocado/entity';
import {Layer} from './layer'; import {Layer} from './layer';
import {LayersUpdateLayerPacket} from './packets/layers-update-layer.packet'; import {LayersUpdateLayerPacket} from './packets/layers-update-layer.packet';

View File

@ -1,7 +1,6 @@
import * as I from 'immutable'; import * as I from 'immutable';
import {compose, EventEmitter, Property} from '@avocado/core'; import {compose, EventEmitter, Property} from '@avocado/core';
import {EntityCreatePacket, EntityPacket, EntityRemovePacket} from '@avocado/entity';
import {Vector} from '@avocado/math'; import {Vector} from '@avocado/math';
import {SynchronizedMixin} from '@avocado/net'; import {SynchronizedMixin} from '@avocado/net';
import {RectangleShape} from '@avocado/physics'; import {RectangleShape} from '@avocado/physics';