function AISMN_MakeWorkDecision::OnEnter(%this,%obj)
{
   return;
}

function AISMN_MakeWorkDecision::OnExit(%this,%obj)
{
   return;
}

//EXIT 0: ERROR (POSSIBLY NO WORKPLACE)
//EXIT 1: WORK AT WORK OBJECT
//EXIT 2: NO WORK HOT SPOTS
//EXIT 3: WORK HAS HOT SPOTS
function AISMN_MakeWorkDecision::Update(%this,%obj)
{
   %workplace = GetWorkplace(%obj);
   if(0 != %workplace)
   {
      %component = slgQueryInterface(%workplace, $CID_BUILDING);
      //If there's no component, report an error. 
      if (!%component)
      {
         ReturnValue(%obj,0);
         return;
      }
      
      //If no hot spots are available, report this.
      if(%workplace.numAvailableHotSpots() == 0)
      {
         ReturnValue(%obj,2);
         return;
      }
      
      //If the character works at an external source, report it.
      if(%component.employeesWorkExternally())
      {
         ReturnValue(%obj,1);
         return;
      }

      ReturnValue(%obj,3);
      return;
   }
   ReturnValue(%obj,0);
   return;
}