internal void Reset(WorldFile worldFile) { for (int y = 0; y < _beepers.GetLength(1); y++) { for (int x = 0; x < _beepers.GetLength(0); x++) { _beepers[x, y] = 0; BeeperCountChanged.Invoke(new Vector2Int(x, y), 0); } } foreach (var beeper in worldFile.Beepers) { _beepers[beeper.Position.x, beeper.Position.y] = beeper.Count; BeeperCountChanged.Invoke(beeper.Position, beeper.Count); } }
public void RemoveBeeper(Vector2Int position) { _beepers[position.x, position.y]--; BeeperCountChanged?.Invoke(position, _beepers[position.x, position.y]); }
public void PlaceBeeper(Vector2Int position) { _beepers[position.x, position.y]++; BeeperCountChanged?.Invoke(position, _beepers[position.x, position.y]); }