private void updateTerriers(Entity ent, bool color) { if (_elements.Keys.Contains(ent) == false) { _elements.Add(ent, new TerrierCompassElement(computeCompassLocation(ent.Location))); } else { if (ent.IsOnScreen()) { _elements[ent].IsRevealed = true; // COloration algo, not working if outputs can be the same for multiple terriers //var terrierCompass = _elements[ent] as TerrierCompassElement; //if (terrierCompass.IsColouredIn == false) //{ // // Autocolor linked terriers // // Choose a color // Color randColor = _availableColors[Application.Random.GetRandomInt(_availableColors.Count)]; // _availableColors.Remove(randColor); // terrierCompass.ColorIn = randColor; // terrierCompass.IsColouredIn = true; // // Other terrier color // var linkedTerrier = ((OTerrier)ent).LinkedTerrier; // if (linkedTerrier != null) // { // updateTerriers(linkedTerrier, false); // var linkedTerrierCompass = _elements[linkedTerrier] as TerrierCompassElement; // linkedTerrierCompass.IsColouredOut = true; // linkedTerrierCompass.ColorOut = randColor; // } //} } } }
private void updatePlayers(Entity ent) { if (_elements.Keys.Contains(ent) == false) { _elements.Add(ent, new PlayerCompassElement(computeCompassLocation(ent.Location))); } else { _elements[ent].Location = computeCompassLocation(ent.Location); } }
private void updateShips(Entity ent) { if (_elements.Keys.Contains(ent) == false) { _elements.Add(ent, new ShipCompassElement(computeCompassLocation(ent.Location))); } }
private void updateKeys(Entity ent) { if (_elements.Keys.Contains(ent) == false) { _elements.Add(ent, new KeysCompassElement(computeCompassLocation(ent.Location))); } else { if (ent.IsOnScreen()) { _elements[ent].IsRevealed = true; } } }