Beispiel #1
0
        public Field GetFieldFromRegion(Vector2i fieldCoords)
        {
            for (int i = 0; i < Regions.Count; i++)
            {
                Region region = Regions.ElementAt(i);

                if (region.HasField(fieldCoords))
                {
                    return(region.GetFieldAtMapCoords(fieldCoords));
                }
            }

            return(null);
        }
Beispiel #2
0
        public Region GetRegionFromFieldCoords(Vector2i fieldCoords)
        {
            for (int i = 0; i < Regions.Count; i++)
            {
                Region region = Regions.ElementAt(i);

                if (region.HasField(fieldCoords))
                {
                    return(region);
                }
            }

            return(null);
        }
Beispiel #3
0
        public Region GetRegionFromMapCoords(Vector2i mapCoords)
        {
            for (int i = 0; i < Regions.Count; i++)
            {
                Region region = Regions.ElementAt(i);

                if (region.Coords.Equals(mapCoords))
                {
                    return(region);
                }
            }

            return(null);
        }
Beispiel #4
0
        public void add(string nameTown, int idTown, string nameDepartament, int idDept, int cantPeople, string covid, int cantConfirm, string region, double latitud, double longitud)
        {
            Region region1 = null;

            for (int i = 0; i < size; i++)
            {
                if (Regions.ElementAt(i).name.Equals(region))
                {
                    region1 = Regions.ElementAt(i);
                    break;
                }
            }
            if (region1 == null)
            {
                region1 = new Region(region);
                Regions.Add(region1);
                size++;
            }

            region1.add(nameTown, idTown, nameDepartament, idDept, cantPeople, covid, cantConfirm, latitud, longitud);
        }