예제 #1
0
 public void modificaHabitat(T_habitats habitat)
 {
     indiceHabitat = (int)habitat;
 }
예제 #2
0
 //Devuelve si un hábitat es habitable para un vegetal
 public bool esHabitable(T_habitats habitat)
 {
     return (especie.habitats.Contains(habitat));
 }
예제 #3
0
 public Vegetal(int idSer, EspecieVegetal especie, int posX, int posY, T_habitats habitatActual, int numVegetales,GameObject modelo)
 {
     this.idSer = idSer;
     this.especie = especie;
     this.posX = posX % FuncTablero.altoTablero;
     this.posY = posY % FuncTablero.anchoTablero;
     FuncTablero.convierteCoordenadas(ref posX,ref posY);
     this.numVegetales = numVegetales;
     this.turnosEvolucion = especie.turnosEvolucionInicial;
     this.indiceHabitat = (int)habitatActual;
     this.modelos = new List<GameObject>();
     modelos.Add(modelo);
 }
예제 #4
0
 //Devuelve si un hábitat es habitable para un vegetal
 public bool esHabitable(T_habitats habitat,float habitabilidadMinima)
 {
     return (habitabilidad[(int)habitat] > habitabilidadMinima);
 }
예제 #5
0
 public Vegetal(int idSer, EspecieVegetal especie, int posX, int posY, List<float> habitabilidad, T_habitats habitatActual, GameObject modelo)
 {
     this.idSer = idSer;
     this.especie = especie;
     FuncTablero.convierteCoordenadas(ref posX,ref posY);
     this.posX = posX;
     this.posY = posY;
     this.numVegetales = especie.numIniVegetales;
     this.turnosEvolucion = especie.turnosEvolucionInicial;
     this.habitabilidad = habitabilidad;
     this.indiceHabitat = (int)habitatActual;
     this.modelos = new List<GameObject>();
     modelos.Add(modelo);
 }
예제 #6
0
 public bool tieneHabitat(T_habitats habitat)
 {
     return habitats.Contains(habitat);
 }
예제 #7
0
 //Devuelve true si ha conseguido eliminar el hábitat, false si no existe
 public bool eliminarHabitat(T_habitats habitat)
 {
     return habitats.Remove(habitat);
 }
예제 #8
0
 //Devuelve true si ha conseguido introducir el hábitat, false si ya ha sido introducido
 public bool aniadirHabitat(T_habitats habitat)
 {
     if(habitats.Contains(habitat))
         return false;
     habitats.Add(habitat);
     return true;
 }
예제 #9
0
 public Casilla(T_habitats hab, T_elementos elems, Vector2 coord, Vector3 vert)
 {
     habitat = hab;
     elementos = elems;
     coordsTex = coord;
     vegetal = null;
     animal = null;
     edificio = null;
     coordsVert = vert;
 }