public void SetAnt(Character ant, OptionSimulator op) { _op = op; _direction = ant.Direction; Field = (Field)ant.Position; _lifeAnt.DisplayedString = " +" + ant.Life.ToString(); _nameAnt.DisplayedString = ant.Name; if (ant.Life <= 50) { _lifeAnt.Color = Color.Red; } else { _lifeAnt.Color = Color.Green; } }
public Simulator(RenderWindow app, int dimmension) { Height = dimmension; Width = dimmension; _clock = new Stopwatch(); _lastTimeSimulate = -10000; _tilePheromone = new TilePheromone(); _tileAntHill = new TileAntHill(); _tileAnt = new TileAnt(); _tileAntQueen = new TileAntQueen(); _tileAntFighter = new TileAntFighter(); _tileBg = new TileBackground(); _tileMapHalo = new TileMapHalo(); _tileMap = new TileMap(); _tileChickenMeet = new TileFood(); World = new World(dimmension, dimmension); _panelBottom = new PanelBottom(app); _panelTop = new PanelTop(app); Active = false; _didSelectField = false; _modeZoom = false; _app = app; _option = new OptionSimulator(); var view = _app.GetView(); view.Center = new Vector2f(0, dimmension * 25); // var size = new Vector2f(view.Size.X * 2.0f, view.Size.Y * 2.0f); // view.Size = size; _app.SetView(view); _app.KeyReleased += OnKeyRelead; _app.KeyPressed += OnKeyPressed; _app.MouseButtonPressed += OnMouseButtonPressed; _app.MouseButtonReleased += OnMouseButtonReleased; _clock.Start(); _app.SetFramerateLimit(160); }
public void SetAnt(Character ant, OptionSimulator op) { _op = op; _isCarry = false; _direction = ant.Direction; Field = (Field)ant.Position; _lifeAnt.DisplayedString = " +" + ant.Life.ToString(); _nameAnt.DisplayedString = ant.Name; if (ant.GetType() == typeof(AntPicker) && ((AntPicker)ant).ListObject.Count > 0) { _isCarry = true; } if (ant.Life <= 50) { _lifeAnt.Color = Color.Red; } else { _lifeAnt.Color = Color.Green; } }