Esempio n. 1
0
File: MapCM.cs Progetto: AciesNN/cyc
		public int GetBuildCountAtIsland(IslandCM island, Build build, bool withMetro)
		{
			int res = island.Slots.FindAll(b => b == build).Count + (withMetro && island.HasMetro ? 1 : 0);

			return res;
		}
Esempio n. 2
0
		void AddIsland(int owner, int hornsCount, List<Hex> cells)
		{
			List<Build> slots = Enumerable.Repeat(Build.None, cells.Count).ToList();

			IslandCM island = new IslandCM()
			{
				ID = map.Islands.Count,
				OwnerID = owner,
				Cells = cells,
				Horns = hornsCount,
				Slots = slots
			};

			map.Islands.Add(island);

			if (owner != PlayerInfoCM.NoID)
			{
				ArmyUnitCM army = new ArmyUnitCM()
				{
					OwnerID = owner,
					IslandID = map.Islands.Count - 1
				};

				map.Army.Add(army);
			}
		}