예제 #1
0
파일: Faction.cs 프로젝트: weichx/SpaceGame
 public FactionDefinition(Faction faction)
 {
     factionName  = faction.Name;
     dispositions = new DispPair[faction.dispositions.Count];
     for (int i = 0; i < dispositions.Length; i++)
     {
         Disposition disposition = faction.GetDisposition(factions[i]);
         dispositions[i]             = new DispPair();
         dispositions[i].name        = factions[i].Name;
         dispositions[i].disposition = Enum.GetName(typeof(Disposition), disposition);
     }
 }
예제 #2
0
파일: Faction.cs 프로젝트: weichx/SpaceGame
 private static void AssignDispositions(Faction faction, DispPair[] dispositions)
 {
     for (int i = 0; i < dispositions.Length; i++)
     {
         DispPair pair  = dispositions[i];
         Faction  other = GetFaction(pair.name);
         if (other == null)
         {
             DebugConsole.Log("Unable to find faction called ", pair.name);
         }
         else
         {
             faction.SetDisposition(other, pair.GetDispositionValue());
         }
     }
 }