import { Vector3 } from "three";
import { PropC } from "../Map/PropC";
import { ResourceFlyC } from "./ResourceFlyC";
import { ResourceType } from "./ResourceType";

export class ResourceSpawnC {
  static spawnFromProp(prop: PropC, type: ResourceType, count: number) {
    if (count <= 0) return;

    const origin = prop.object.getWorldPosition(new Vector3());

    for (let i = 0; i < count; i++) {
      ResourceFlyC.launch(origin, type, i, count);
    }
  }
}
