//Returns a unique clan name for the supremecommander public string GetClan() { string clan = ""; string clanColor = ""; foreach (KeyValuePair <string, Color> color in colors) { if (!clans.Contains(color.Key + " Clan")) { clan = color.Key + " Clan"; clanColor = color.Key; break; } } clans.Add(clan); TribeFacts fact = new TribeFacts(clanColor, new TaskTree()); tribeFacts.Add(clan, fact); //default worldstate for the clan WorldState currentWorldState = new WorldState(); currentWorldState.SetProperty("blueResourceIsAvailable", new WorldStateValue(false)); currentWorldState.SetProperty("redResourceIsAvailable", new WorldStateValue(false)); currentWorldState.SetProperty("yellowResourceIsAvailable", new WorldStateValue(false)); currentWorldState.SetProperty("orangeResourceIsAvailable", new WorldStateValue(false)); currentWorldState.SetProperty("greenResourceIsAvailable", new WorldStateValue(false)); currentWorldState.SetProperty("magentaResourceIsAvailable", new WorldStateValue(false)); SetFact(clan, "currentWorldState", new WorkingMemoryValue(currentWorldState)); return(clan); }
//Returns a unique clan name for the supremecommander public string GetClan() { string clan = ""; string clanColor = ""; foreach(KeyValuePair<string, Color> color in colors) { if(!clans.Contains(color.Key + " Clan")) { clan = color.Key + " Clan"; clanColor = color.Key; break; } } //clan = "Red Clan"; clans.Add(clan); TribeFacts fact = new TribeFacts(clanColor, new TaskTree()); tribeFacts.Add(clan, fact); WorldState currentWorldState = new WorldState(); currentWorldState.setProperty("blueResourceIsAvailable", new WorldStateValue(false)); currentWorldState.setProperty("redResourceIsAvailable", new WorldStateValue(false)); currentWorldState.setProperty("yellowResourceIsAvailable", new WorldStateValue(false)); currentWorldState.setProperty("orangeResourceIsAvailable", new WorldStateValue(false)); currentWorldState.setProperty("greenResourceIsAvailable", new WorldStateValue(false)); currentWorldState.setProperty("magentaResourceIsAvailable", new WorldStateValue(false)); //SetCurrentWorldstate(clan, currentWorldState); SetFact(clan, "currentWorldState", new WorkingMemoryValue(currentWorldState)); return clan; }