Skip to content

Commit

Permalink
exportを宣言と同時に記述
Browse files Browse the repository at this point in the history
  • Loading branch information
kazakami committed Dec 5, 2018
1 parent 232a0d6 commit 58bc85b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 25 deletions.
10 changes: 3 additions & 7 deletions src/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as THREE from "three";
import { Scene } from "./Scene";
import { Base64toBlob, Coalescing } from "./Util";

class CoreOption {
export class CoreOption {
public antialias?: boolean;
public parent?: HTMLElement;
public windowSizeX?: number;
Expand All @@ -24,7 +24,7 @@ class CoreOption {
}
}

class Core {
export class Core {
public mouseX: number = 0;
public mouseY: number = 0;
public windowSizeX: number;
Expand Down Expand Up @@ -697,13 +697,9 @@ class Core {
* @param defaultSceneName 初期シーンの名前
* @param defaultScene 初期シーン
*/
function Start(defaultSceneName: string, defaultScene: Scene, option?: CoreOption): Core {
export function Start(defaultSceneName: string, defaultScene: Scene, option?: CoreOption): Core {
const modifiedOption = new CoreOption(Coalescing(option, {}));
const core = new Core(modifiedOption);
core.Init(defaultSceneName, defaultScene);
return core;
}

export { Start };
export { Core };
export { CoreOption };
14 changes: 6 additions & 8 deletions src/PhysicObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Cannon from "cannon";
import * as THREE from "three";
import { OrientQuaternion, UndefCoalescing } from "./Util";

class CollideData {
export class CollideData {
// 多分これが衝突相手
public body: Cannon.Body;
// 衝突に関する情報
Expand All @@ -24,7 +24,7 @@ class CollideData {
}
}

abstract class PhysicObject {
export abstract class PhysicObject {
public viewBody: THREE.Object3D;
public phyBody: Cannon.Body;
public collideCallBack: (data: CollideData) => void;
Expand Down Expand Up @@ -90,7 +90,7 @@ abstract class PhysicObject {
}
}

class PhysicSphere extends PhysicObject {
export class PhysicSphere extends PhysicObject {
constructor(mass: number, radius: number, name: string = "sphere", obj: THREE.Object3D = null) {
super(name, mass);
if (obj === null) {
Expand All @@ -109,7 +109,7 @@ class PhysicSphere extends PhysicObject {
}
}

class PhysicPlane extends PhysicObject {
export class PhysicPlane extends PhysicObject {
constructor(mass: number, name: string = "plane", obj: THREE.Object3D = null) {
super(name, mass);
if (obj === null) {
Expand All @@ -128,7 +128,7 @@ class PhysicPlane extends PhysicObject {
}
}

class PhysicBox extends PhysicObject {
export class PhysicBox extends PhysicObject {
constructor(mass: number, width: number, height: number, depth: number,
name: string = "box", obj: THREE.Object3D = null) {
super(name, mass);
Expand All @@ -148,7 +148,7 @@ class PhysicBox extends PhysicObject {
}
}

class PhysicObjects extends PhysicObject {
export class PhysicObjects extends PhysicObject {
constructor(mass: number, name: string = "") {
super(name, mass);
this.viewBody = new THREE.Group();
Expand Down Expand Up @@ -205,5 +205,3 @@ class PhysicObjects extends PhysicObject {
return;
}
}

export { PhysicObject, PhysicSphere, PhysicPlane, PhysicBox, PhysicObjects };
4 changes: 1 addition & 3 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { PhysicUnit, Unit } from "./Unit";
* Sceneの基底クラス、これを継承して用いる
* Init()に起動時の処理を追加する
*/
abstract class Scene {
export abstract class Scene {
public units: Unit[] = [];
public core: Core = null;
public scene: THREE.Scene;
Expand Down Expand Up @@ -324,5 +324,3 @@ abstract class Scene {
});
}
}

export { Scene };
4 changes: 1 addition & 3 deletions src/TiledTexturedSprite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as THREE from "three";

class TiledTexturedSprite {
export class TiledTexturedSprite {
public tex: THREE.Texture;
public mat: THREE.SpriteMaterial;
public sprite: THREE.Sprite;
Expand All @@ -27,5 +27,3 @@ class TiledTexturedSprite {
this.mat.dispose();
}
}

export { TiledTexturedSprite };
6 changes: 2 additions & 4 deletions src/Unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TiledTexturedSprite } from "./TiledTexturedSprite";
* Unitの基底クラス、これを継承して用いる
* 基本的にコンストラクタ値の受け渡しにのみ用い、Init()に起動時の処理を追加する
*/
abstract class Unit {
export abstract class Unit {
public isAlive: boolean = true;
public priority: number = 0;
public core: Core = null;
Expand Down Expand Up @@ -110,7 +110,7 @@ abstract class Unit {
}
}

class PhysicUnit extends Unit {
export class PhysicUnit extends Unit {
public Init() {
return;
}
Expand All @@ -121,5 +121,3 @@ class PhysicUnit extends Unit {
return;
}
}

export { Unit, PhysicUnit };

0 comments on commit 58bc85b

Please sign in to comment.