Skip to content

Commit

Permalink
Fixed a repeated typo across multiple files
Browse files Browse the repository at this point in the history
- changed entity.copyFormPacketData(props) to entity.copyFromPacketData(props) in multiple files
- changed `"Receive entity data:`, data)" to "Receive entity data:", data.length.toString())"
  • Loading branch information
Aitolda committed Oct 7, 2024
1 parent 1904842 commit 118d772
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 23 deletions.
10 changes: 5 additions & 5 deletions src/modules/entity/EntityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class EntityManager {
return undefined;
}
const entity = factory(props.entityItemID.stringify());
entity.copyFormPacketData(props);
entity.copyFromPacketData(props);
// prevent to emit change event
entity.update();

Expand All @@ -99,7 +99,7 @@ export class EntityManager {
public updateEntity(props: EntityProperties): void {
const entity = this._entities.get(props.entityItemID.stringify());
if (entity) {
entity.copyFormPacketData(props);
entity.copyFromPacketData(props);
}
}

Expand All @@ -114,7 +114,7 @@ export class EntityManager {
this._entityPropertiesArray.forEach((props) => {
const entity = this._entities.get(props.entityItemID.stringify());
if (entity) {
entity.copyFormPacketData(props);
entity.copyFromPacketData(props);
} else {
this.createEntity(props);
}
Expand All @@ -124,9 +124,9 @@ export class EntityManager {
}

private _handleOnEntityData(data: EntityProperties[]): void {
if (data.length > 0) {
if (data && data.length > 0) {
Log.info(Log.types.ENTITIES,
`Receive entity data:`, data);
"Receive entity data:", data.length.toString());

this._entityPropertiesArray = this._entityPropertiesArray.concat(data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class ZoneEntityController extends EntityController {
}

// reload sky box mesh
if (this._skybox) {
if (this._skybox && this._scene.activeCamera) {
this._skybox.load(this._zoneEntity.skybox, this._zoneEntity.dimensions, this._zoneEntity.id, this._scene.activeCamera);
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/entity/entities/Entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export abstract class Entity implements IEntity {
});
}

public copyFormPacketData(props: EntityProperties): void {
public copyFromPacketData(props: EntityProperties): void {
this.name = props.name;
this.position = props.position;
this.rotation = props.rotation;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/entity/entities/ImageEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export class ImageEntity extends Entity implements IImageEntity {
return this._onImageURLChanged.observable;
}

public copyFormPacketData(props: EntityProperties): void {
super.copyFormPacketData(props);
public copyFromPacketData(props: EntityProperties): void {
super.copyFromPacketData(props);

const imageProps = props as ImageEntityProperties;
this.imageURL = imageProps.imageURL;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/entity/entities/LightEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export class LightEntity extends Entity implements ILightEntity {
return this._onLightTypeChanged.observable;
}

public copyFormPacketData(props: EntityProperties): void {
super.copyFormPacketData(props);
public copyFromPacketData(props: EntityProperties): void {
super.copyFromPacketData(props);

const lightProps = props as LightEntityProperties;

Expand Down
4 changes: 2 additions & 2 deletions src/modules/entity/entities/ModelEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export class ModelEntity extends Entity implements IModelEntity {
return this._animation;
}

public copyFormPacketData(props: EntityProperties): void {
super.copyFormPacketData(props);
public copyFromPacketData(props: EntityProperties): void {
super.copyFromPacketData(props);

const modelProps = props as ModelEntityProperties;
this.modelURL = modelProps.modelURL;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/entity/entities/ShapeEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export class ShapeEntity extends Entity implements IShapeEntity {
return this._onColorChanged.observable;
}

public copyFormPacketData(props: EntityProperties): void {
super.copyFormPacketData(props);
public copyFromPacketData(props: EntityProperties): void {
super.copyFromPacketData(props);

const shapeProps = props as ShapeEntityProperties;
this.shape = shapeProps.shape;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/entity/entities/WebEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export class WebEntity extends Entity implements IWebEntity {
return this._onWebPropertiesChanged.observable;
}

public copyFormPacketData(props: EntityProperties): void {
super.copyFormPacketData(props);
public copyFromPacketData(props: EntityProperties): void {
super.copyFromPacketData(props);

const webProps = props as WebEntityProperties;
this.sourceUrl = webProps.sourceURL;
Expand Down
10 changes: 6 additions & 4 deletions src/modules/entity/entities/ZoneEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//

import { ShapeType, IAmbientLightProperty, IKeyLightProperty,
import {
ShapeType, IAmbientLightProperty, IKeyLightProperty,
ISkyboxProperty, IHazeProperty, IBloomProperty, ComponentMode,
AvatarPriorityMode } from "../EntityProperties";
AvatarPriorityMode
} from "../EntityProperties";
import { IEntity, IZoneEntity } from "../EntityInterfaces";
import { Entity, EntityPropertyChangeObservable } from "./Entity";
import { EntityProperties, ZoneEntityProperties } from "@vircadia/web-sdk";
Expand Down Expand Up @@ -202,8 +204,8 @@ export class ZoneEntity extends Entity implements IZoneEntity {
}
}

public copyFormPacketData(props: EntityProperties): void {
super.copyFormPacketData(props);
public copyFromPacketData(props: EntityProperties): void {
super.copyFromPacketData(props);

const zoneProps = props as ZoneEntityProperties;

Expand Down
4 changes: 2 additions & 2 deletions src/modules/entity/entities/materialEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export class MaterialEntity extends Entity implements IMaterialEntity {
}


public copyFormPacketData(props: EntityProperties): void {
super.copyFormPacketData(props);
public copyFromPacketData(props: EntityProperties): void {
super.copyFromPacketData(props);

const materialProps = props as MaterialEntityProperties;

Expand Down

0 comments on commit 118d772

Please sign in to comment.