Example #1
0
    protected override void Start()
    {
        numInteractuablesEnTransito = 0;

        //Carga los datos del directorio predeterminado o del de guardado si hay datos guardados
        if (System.IO.File.Exists(Manager.rutaInterDatosGuardados + ID.ToString() + ".xml"))
        {
            datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatosGuardados + ID.ToString() + ".xml");
        }
        else
        {
            datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatos + ID.ToString() + ".xml");
        }

        //Ejecuta el metodo del padre
        base.Start();

        obstacle = GetComponent <NavMeshObstacle>();

        //Establece el nombre del interactuable
        SetNombre(datos.DevuelveNombreActual());

        if (datos.DevuelveIDTransporte() != -1)
        {
            CrearTransporte(datos.DevuelveIDTransporte());
        }
    }
Example #2
0
	public void CargarValor(int IDObjeto, int numVariable, int valorNegativo)
	{
		GameObject interactuableGO = Manager.instance.GetInteractuable(IDObjeto);

		if(interactuableGO == null)
		{
			//Carga los datos del directorio predeterminado o del de guardado si hay datos guardados
			if (System.IO.File.Exists(Manager.rutaInterDatosGuardados + IDObjeto.ToString()  + ".xml"))
			{
				datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatosGuardados + IDObjeto.ToString()  + ".xml");
			}
			else
			{
				datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatos + IDObjeto.ToString()  + ".xml");
			}
		}
		else
		{
			InteractuableObjeto interactuableObjeto = interactuableGO.GetComponent<InteractuableObjeto>();
			datos = interactuableObjeto.DevuelveDatos();
		}

		valorInicial = datos.DevuelveValorVariable(numVariable);

		if(valorInicial == valorNegativo)
			activado = false;
		else
			activado = true;

		this.numVariable = numVariable;
		activadoActual = activado;

		CargarLuz();
	}
Example #3
0
	protected override void Start()
	{
		numInteractuablesEnTransito = 0;

		//Carga los datos del directorio predeterminado o del de guardado si hay datos guardados
		if (System.IO.File.Exists(Manager.rutaInterDatosGuardados + ID.ToString()  + ".xml"))
		{
			datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatosGuardados + ID.ToString()  + ".xml");
		}
		else
		{
			datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatos + ID.ToString()  + ".xml");
		}

		//Ejecuta el metodo del padre
		base.Start();

		obstacle = GetComponent<NavMeshObstacle>();

		//Establece el nombre del interactuable
		SetNombre(datos.DevuelveNombreActual());

		if(datos.DevuelveIDTransporte() != -1)
			CrearTransporte(datos.DevuelveIDTransporte());
	}
        public ObjetoDatos CrearObjetoDatos(IPropiedad propiedad, ObjetoDatos propietario)
        {
            ObjetoDatos od = _impl.CrearObjetoDatos(propiedad, propietario);

            _historial.CrearObjetoDatos(_impl, propiedad, od, ResolverIndice(propiedad, od));
            return(od);
        }
Example #5
0
 private void ActualizarPropiedad(IObjetoDatos od, IPropiedad propiedad)
 {
     if (propiedad.Tipo.EsTipoDeDato || propiedad.Asociacion == Asociacion.Agregacion || od.ObtenerObjetoDatos(propiedad) == null)
     {
         ObjetoDatos.Establecer(propiedad, od.Obtener(propiedad));
     }
     else if (propiedad.Asociacion == Asociacion.Composicion)
     {
         CrearObservador(od.ObtenerObjetoDatos(propiedad), ObjetoDatos.CrearObjetoDatos(propiedad));
     }
 }
Example #6
0
 private void ActualizarColeccion(IObjetoDatos od, IPropiedad propiedad, Accion accion, IObjetoDatos item, int indice)
 {
     if (accion == Accion.Agregar)
     {
         CrearObservador(item, ObjetoDatos.CrearObjetoDatos(propiedad));
     }
     else if (accion == Accion.Remover)
     {
         ObjetoDatos.RemoverObjetoDatos(propiedad, ObjetoDatos.ObtenerColeccion(propiedad)[indice]);
     }
 }
        private int ResolverIndice(IPropiedad propiedad, ObjetoDatos item)
        {
            int indice = 0;

            if (propiedad.Cardinalidad >= Cardinalidad.Muchos)
            {
                indice = _impl.ObtenerColeccion(propiedad).Indice(item);
            }

            return(indice);
        }
Example #8
0
    public void CargarValor(int IDObjeto, int numVariable, int valorNegativo)
    {
        GameObject interactuableGO = Manager.instance.GetInteractuable(IDObjeto);

        if (interactuableGO == null)
        {
            //Carga los datos del directorio predeterminado o del de guardado si hay datos guardados
            if (System.IO.File.Exists(Manager.rutaInterDatosGuardados + IDObjeto.ToString() + ".xml"))
            {
                datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatosGuardados + IDObjeto.ToString() + ".xml");
            }
            else
            {
                datos = ObjetoDatos.LoadInterDatos(Manager.rutaInterDatos + IDObjeto.ToString() + ".xml");
            }
        }
        else
        {
            InteractuableObjeto interactuableObjeto = interactuableGO.GetComponent <InteractuableObjeto>();
            datos = interactuableObjeto.DevuelveDatos();
        }

        valorInicial = datos.DevuelveValorVariable(numVariable);

        if (valorInicial == valorNegativo)
        {
            activado = false;
        }
        else
        {
            activado = true;
        }

        this.numVariable = numVariable;
        activadoActual   = activado;

        CargarLuz();
    }
 public IObjetoDatosImpl Crear(ITipo tipo, ObjetoDatos propietario)
 {
     return(new DecoradorHistorial(_impl.Crear(tipo, propietario), _historial));
 }
 private void RemoverObjetoDatos(IPropiedad propiedad, ObjetoDatos item, int indice)
 {
     _impl.RemoverObjetoDatos(propiedad, item);
     _historial.RemoverObjetoDatos(_impl, propiedad, item, indice);
 }
 private void EstablecerObjetoDatos(IPropiedad propiedad, ObjetoDatos valor, ObjetoDatos valorInicial)
 {
     _impl.EstablecerObjetoDatos(propiedad, valor);
     _historial.EstablecerObjetoDatos(_impl, propiedad, valor, valorInicial);
 }
 public void RemoverObjetoDatos(IPropiedad propiedad, ObjetoDatos item)
 {
     RemoverObjetoDatos(propiedad, item, _impl.ObtenerColeccion(propiedad).Indice(item));
 }
 public void AgregarObjetoDatos(IPropiedad propiedad, ObjetoDatos item)
 {
     _impl.AgregarObjetoDatos(propiedad, item);
     _historial.AgregarObjetoDatos(_impl, propiedad, item, _impl.ObtenerColeccion(propiedad).Indice(item));
 }
 public void EstablecerObjetoDatos(IPropiedad propiedad, ObjetoDatos valor)
 {
     EstablecerObjetoDatos(propiedad, valor, _impl.ObtenerObjetoDatos(propiedad));
 }
Example #15
0
    //Devuelve el InterDatos de un xml indicado en la ruta
    public new static ObjetoDatos LoadInterDatos(string path)
    {
        ObjetoDatos interDatos = Manager.instance.DeserializeData <ObjetoDatos>(path);

        return(interDatos);
    }