Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public string Save(bool temp = false) {
save.levelInfo = new LevelInfo(core.levelName, core.authorName, DateTime.Now);


save.clans = teams.dictWithAllInfo();
save.clans = teams.DictWithAllInfo();

ErrorMessages.text += " displayName:(" + save.levelInfo.levelName + ")";
formatter.Serialize(file, save);
Expand Down
48 changes: 24 additions & 24 deletions Dots-RTS-Development/Assets/Scripts/LevelEditor/TeamSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,24 +209,10 @@ static void DestroyAllInList(List<GameObject> list) {
Destroy(list[i]);
}
}
public void UpdateRoundTableVisuals() {

Dictionary<Cell.enmTeam, AIHolder>.KeyCollection keysDebug = clanDict.Keys;
foreach (Cell.enmTeam team in keysDebug) {
AIHolder holder = new AIHolder();
clanDict.TryGetValue(team, out holder);
string s = " ";
foreach (Cell.enmTeam ally in holder.allies) {
s += (ally + " ");
}
print("Team: " + team + " has allies" + s);
}


DestroyAllInList(bgList);
List<List<Cell.enmTeam>> CDToActualClans(Dictionary<Cell.enmTeam, AIHolder> dict) {
List<List<Cell.enmTeam>> actualClans = new List<List<Cell.enmTeam>>();

Dictionary<Cell.enmTeam, AIHolder>.KeyCollection keys = clanDict.Keys;
Dictionary<Cell.enmTeam, AIHolder>.KeyCollection keys = dict.Keys;
foreach (Cell.enmTeam j in keys) {
//print(j + " Key");
AIHolder value;
Expand All @@ -245,16 +231,35 @@ public void UpdateRoundTableVisuals() {
}

}
if (newClan) {
if (newClan && clanJ.Count > 1) {
actualClans.Add(clanJ);
}

}
return actualClans;
}

public void UpdateRoundTableVisuals() {

//Dictionary<Cell.enmTeam, AIHolder>.KeyCollection keysDebug = clanDict.Keys;
//foreach (Cell.enmTeam team in keysDebug) {
// AIHolder holder = new AIHolder();
// clanDict.TryGetValue(team, out holder);
// string s = " ";
// foreach (Cell.enmTeam ally in holder.allies) {
// s += (ally + " ");
// }
// print("Team: " + team + " has allies" + s);
//}


DestroyAllInList(bgList);

List<TeamBox> newList = new List<TeamBox>(teamBoxes);

float angle = 0;


List<List<Cell.enmTeam>> actualClans = CDToActualClans(clanDict);
for (int i = 0; i < actualClans.Count; i++) {
GameObject bg = Instantiate(clanBG, roundTable);
bgList.Add(bg);
Expand Down Expand Up @@ -285,11 +290,6 @@ public void UpdateRoundTableVisuals() {
}
rt.rotation = Quaternion.Euler(0, 0, -lastTeamBoxAngle);

}

foreach (List<Cell.enmTeam> clan in actualClans) {
print("Useless loop says Hi! ... seriously, why is this here ?");

}
foreach (TeamBox t in newList) {
t.transform.localPosition = AngleToPos(angle);
Expand Down Expand Up @@ -339,7 +339,7 @@ public int MySpawnsIndexFromAngle(float RawAngle) {
return output;
}

public Dictionary<Cell.enmTeam,AIHolder> dictWithAllInfo() {
public Dictionary<Cell.enmTeam,AIHolder> DictWithAllInfo() {
Dictionary<Cell.enmTeam, AIHolder> newDict = new Dictionary<Cell.enmTeam, AIHolder>();
Dictionary<Cell.enmTeam, AIHolder>.KeyCollection TeamKeys = clanDict.Keys;
List<Cell.enmTeam> noClaners = new List<Cell.enmTeam>(core.teamList);
Expand Down