//-------------------------------------------------------------------
//
//  This code is copyright 2001 by G5 Software.
//  Any unauthorized usage, either in part or in whole of this code
//  is strictly prohibited. Violators WILL be prosecuted to the
//  maximum extent allowed by law.
//
//-------------------------------------------------------------------

class CAffiliation
{
  String GetAffiliation()
  {
    if (checkMask(user, ["ENEMY"], []))
      return "ENEMY";
    else
    if (checkMask(user, ["FRIEND"], []))
      return "FRIEND";
    else
      return "NEUTRAL";
  }

  void SetAffiliation(
      String _Affiliation
    )
  {
    removeClassificator(user, "NEUTRAL");
    removeClassificator(user, "ENEMY");
    removeClassificator(user, "FRIEND");

    if (_Affiliation == "NEUTRAL")
      addClassificator(user, "NEUTRAL");
    else
    if (_Affiliation == "ENEMY")
      addClassificator(user, "ENEMY");
    else
    if (_Affiliation == "FRIEND")
      addClassificator(user, "FRIEND");
    else
      logError("Unknown affiliation type: " + Affiliation);
  }
}
