Beispiel #1
0
        public Map(int x, int y, asd.Color color)
        {
            _x = x;
            _y = y;

            _color = color;
        }
Beispiel #2
0
        IEnumerator <int> AnimateTransition(bool isFadeIn)
        {
            if (isFadeIn)
            {
                Color = new asd.Color(255, 255, 255, 0);
            }
            yield return(0);

            while (isFadeIn ? Color.A < 245 : Color.A > 10)
            {
                var temp = Color;
                if (isFadeIn)
                {
                    temp.A += 5;
                }
                else
                {
                    temp.A -= 5;
                }
                Color = temp;
                yield return(0);
            }
            if (isFadeIn)
            {
                Color = new asd.Color(255, 255, 255);
            }
            else
            {
                Dispose();
            }
            yield return(0);
        }
Beispiel #3
0
        public void PaintDeffenceColor()
        {
            var color = new asd.Color(0, 0, 200);

            foreach (var m in _maps)
            {
                m.SetColor(color);
            }
        }
Beispiel #4
0
        public void PaintAttackColor()
        {
            var color = new asd.Color(200, 0, 0);

            foreach (var m in _maps)
            {
                m.SetColor(color);
            }
        }
Beispiel #5
0
        public City(string name, Point[] points, int population)
        {
            _name       = name;
            _population = population;
            _isAlive    = true;
            _maps       = new List <Map>();
            var r = Singleton.Random;

            _color = new asd.Color((byte)r.Next(0, 255), (byte)r.Next(0, 255), (byte)r.Next(0, 255));

            var fieldMap = Singleton.FieldMap;

            foreach (var p in points)
            {
                Map m = new Map(p.x, p.y, _color);
                m.SetCity(this);
                _maps.Add(m);
                fieldMap.SetMap(m);
            }
        }
Beispiel #6
0
 public void SetCity(City city)
 {
     _city  = city;
     _color = city.GetColor();
 }
Beispiel #7
0
 public void SetColor(asd.Color color)
 {
     _geometryObj.Color = color;
 }