/******************************************
* Variables                               *
******************************************/

let RED              = 1;
let BLUE             = -1;
let NONE             = 0;

/******************************************
* Public Functions                        *
******************************************/

sub PolarityManager_Initialize {
  let polarity = GetCommonDataDefault("polarity", 0);
  if( polarity == 0){
    SetCommonData("polarity", RED);
  }
}

// Gets the current color.
function GetPolarity(){
  return GetCommonDataDefault("polarity", RED);
}

// Sets the current colo.
function SetPolarity(col){
  SetCommonData("polarity", col);
}

sub SwitchPolarity {
  if(GetPolarity == RED){
    SetCommonData("polarity", BLUE);
  }
  else if(GetPolarity == BLUE){
    SetCommonData("polarity", RED);
  }
}

// Changes what the engine perceives the current color to be.
sub PolarityManager_Run {
}
  
/******************************************
* Private Functions                       *
******************************************/