public void OnAddUnitToPlanetColony(Building b, UnitType ut)
        {
            if (b == null || ut == null)
            {
                return;
            }

            b.Add(
                Unit.Create(ut, b.Units.Count)
                );
        }
Exemple #2
0
    public void Add(DecayEntity ent)
    {
        if (ent.buildingID == 0)
        {
            if (!decayEntities.Contains(ent))
            {
                decayEntities.Add(ent);
            }
            return;
        }
        Building building = GetBuilding(ent.buildingID);

        if (building == null)
        {
            building = CreateBuilding(ent.buildingID);
            buildingDictionary.Add(ent.buildingID, building);
        }
        building.Add(ent);
        building.Dirty();
    }
Exemple #3
0
        public void Process_AlternateSemitone()
        {
            var building = new Building();
            var part1    = new FakePart("Секция 1", "Этаж 1", "Двухкомнатная", "Квартира 01");
            var part2    = new FakePart("Секция 1", "Этаж 1", "Двухкомнатная", "Квартира 02");
            var part3    = new FakePart("Секция 1", "Этаж 1", "Двухкомнатная", "Квартира 03");
            var part4    = new FakePart("Секция 1", "Этаж 1", "Однокомнатная", "Квартира 04");

            building.Add(new []
            {
                part1,
                part2,
                part3,
                part4,
            });
            building.Process();

            Assert.IsFalse(part1.IsSemistone);
            Assert.IsTrue(part2.IsSemistone);
            Assert.IsFalse(part3.IsSemistone);
        }