// See https://aka.ms/new-console-template for more information
while (true)
{
Console.WriteLine("Estado Inicial");
Shapefile shp4 = new Shapefile();
Console.WriteLine(shp4.getinfoShapefile());
int vertices = 0;
vertices = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(shp4.crearShape(vertices));
}
class Shapefile
{
//Propiedades
private int vertices;
private string tipoGeometria;
//Comportamiento o Constructor Inicial
public Shapefile()
{
vertices = 1;
tipoGeometria = "point";
}
//Comportamientos
public int getVertices()
{
return vertices;
}
public string getinfoShapefile()
{
return "Vertices: "+vertices+" Geometria: "+ tipoGeometria;
}
public string crearShape(int vertices)
{
if (vertices == 2)
return tipoGeometria = "linea";
else
return tipoGeometria = "polilineaLinea";
}
}
No hay comentarios.:
Publicar un comentario