//-----------------------------------------------------------------------------
// Torque Game Engine 
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

datablock MissionMarkerData(WayPointMarker)
{
   category = "Misc";
   shapeFile = "common/data/shapes/octahedron.dts";
};

datablock MissionMarkerData(SpawnSphereMarker)
{
   category = "Misc";
   shapeFile = "common/data/shapes/octahedron.dts";
};

datablock MissionMarkerData(CameraBookmarkMarker)
{
   category = "Misc";
   shapeFile = "common/data/shapes/octahedron.dts";
};


//------------------------------------------------------------------------------
// - serveral marker types may share MissionMarker datablock type
function MissionMarkerData::create(%block)
{
   switch$(%block)
   {
      case "WayPointMarker":
         %obj = new WayPoint() {
            dataBlock = %block;
         };
         return(%obj);
      case "SpawnSphereMarker":
         %obj = new SpawnSphere() {
            datablock = %block;
         };
         return(%obj);
      case "CameraBookmarkMarker":
         %obj = new CameraBookmark() {
            datablock = %block;
         };
         // Place into correct group
         if(!isObject(CameraBookmarks))
         {
            %grp = new SimGroup(CameraBookmarks);
            $InstantGroup.add(%grp);
         }
         CameraBookmarks.add(%obj);
         return(%obj);
   }
   return(-1);
}
