Пример #1
0
 public void AddReputation(Faction fac, int value)
 {
     Debug.Log("inside add rep");
     Debug.Log(FactionRelations.Count);
     Debug.Log(fac.BoardName);
     int preVal = FactionRelations[fac];
     FactionRelations[fac] += value;
     if (FactionRelations[fac] > maxRep)
     {
         FactionRelations[fac] = maxRep;
     }
     else if (FactionRelations[fac] < minRep)
     {
         FactionRelations[fac] = minRep;
     }
     
     if(preVal > 50 && FactionRelations[fac] <= 50)
     {
         DataManager.instance.AllianceChange.Add(fac);
     } else if(preVal < -50 && FactionRelations[fac] >= -50)
     {
         DataManager.instance.AllianceChange.Add(fac);
     } else if(preVal > -50 && FactionRelations[fac] <= -50)
     {
         DataManager.instance.AllianceChange.Add(fac);
     } else if(preVal < 50 && FactionRelations[fac] >= 50)
     {
         DataManager.instance.AllianceChange.Add(fac);
     }
     /*
     foreach (Faction fc in FactionRelations.Keys)
     {
         Debug.Log(fc.BoardName + ", "+ fac.BoardName);
         if(fc.BoardName == fac.BoardName)
         {
             Debug.Log("Rep Before: " + fc.BoardName + " " + FactionRelations[fc]);
             FactionRelations[fc] += value;
             if(FactionRelations[fc] > maxRep)
             {
                 FactionRelations[fc] = maxRep;
             }else if(FactionRelations[fc] < minRep)
             {
                 FactionRelations[fc] = minRep;
             }
             Debug.Log("Rep After: " + fc.BoardName + " " + FactionRelations[fc]);
             break;
         }
     }
     */
 }
Пример #2
0
 public Standing getStanding(Faction f)
 {
     int a = FactionRelations[f];
     if(a >= Fthresh)
     {
         return Standing.FRIENDLY;
     }else if(a <= Ethresh)
     {
         return Standing.ENEMY;
     }
     else
     {
         return Standing.NEUTRAL;
     }
 }
Пример #3
0
 public SavedResult()
 {
     Conditions = new Dictionary<Piece, int>();
     Outcomes = new Dictionary<Piece, int>();
     Alligance = new Faction();
 }