diff --git a/Dots-RTS-Development/Assets/Scripts/LevelEditor/SaveAndLoadEditor.cs b/Dots-RTS-Development/Assets/Scripts/LevelEditor/SaveAndLoadEditor.cs index 5908409..cc1f05a 100644 --- a/Dots-RTS-Development/Assets/Scripts/LevelEditor/SaveAndLoadEditor.cs +++ b/Dots-RTS-Development/Assets/Scripts/LevelEditor/SaveAndLoadEditor.cs @@ -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); diff --git a/Dots-RTS-Development/Assets/Scripts/LevelEditor/TeamSetup.cs b/Dots-RTS-Development/Assets/Scripts/LevelEditor/TeamSetup.cs index fb5fd5c..dd08d66 100644 --- a/Dots-RTS-Development/Assets/Scripts/LevelEditor/TeamSetup.cs +++ b/Dots-RTS-Development/Assets/Scripts/LevelEditor/TeamSetup.cs @@ -209,24 +209,10 @@ static void DestroyAllInList(List list) { Destroy(list[i]); } } - public void UpdateRoundTableVisuals() { - - Dictionary.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> CDToActualClans(Dictionary dict) { List> actualClans = new List>(); - Dictionary.KeyCollection keys = clanDict.Keys; + Dictionary.KeyCollection keys = dict.Keys; foreach (Cell.enmTeam j in keys) { //print(j + " Key"); AIHolder value; @@ -245,16 +231,35 @@ public void UpdateRoundTableVisuals() { } } - if (newClan) { + if (newClan && clanJ.Count > 1) { actualClans.Add(clanJ); } } + return actualClans; + } + + public void UpdateRoundTableVisuals() { + + //Dictionary.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 newList = new List(teamBoxes); float angle = 0; - + List> actualClans = CDToActualClans(clanDict); for (int i = 0; i < actualClans.Count; i++) { GameObject bg = Instantiate(clanBG, roundTable); bgList.Add(bg); @@ -285,11 +290,6 @@ public void UpdateRoundTableVisuals() { } rt.rotation = Quaternion.Euler(0, 0, -lastTeamBoxAngle); - } - - foreach (List clan in actualClans) { - print("Useless loop says Hi! ... seriously, why is this here ?"); - } foreach (TeamBox t in newList) { t.transform.localPosition = AngleToPos(angle); @@ -339,7 +339,7 @@ public int MySpawnsIndexFromAngle(float RawAngle) { return output; } - public Dictionary dictWithAllInfo() { + public Dictionary DictWithAllInfo() { Dictionary newDict = new Dictionary(); Dictionary.KeyCollection TeamKeys = clanDict.Keys; List noClaners = new List(core.teamList);