Ejemplo n.º 1
0
        public City AddLevels(ICityLevelRule cityLevelRule)
        {
            var lvls = cityLevelRule.GetLevels();

            foreach (var lvl in lvls)
            {
                AddLevel(lvl.Key, lvl.Value);
            }
            return(this);
        }
Ejemplo n.º 2
0
        private void BaseConstructor(Region region = null,
                                     ICityLevelRule cityLevelRule = null, Tuple <decimal, decimal> coords = null)
        {
            TmpLevels = new Dictionary <int, int>();
            Coords    = coords;

            //todo: need to remove it (and parameter too) and move to abstract class
            if (region != null)
            {
                region.AddCity(this);
            }
            if (cityLevelRule != null)
            {
                var lvls = cityLevelRule.GetLevels();
                foreach (var lvl in lvls)
                {
                    AddLevel(lvl.Key, lvl.Value);
                }
            }
        }