private void CheckProperty(LightHouse.Core.ContractObject contractObject, PropertyInfo property)
 {
     if (property.PropertyType == typeof(String))
     {
         String value = (String)property.GetValue(contractObject);
         Assert.NotNull(value);
         Assert.Equal(testString, value);
     }
     else if (property.PropertyType == typeof(DateTime))
     {
         DateTime value = (DateTime)property.GetValue(contractObject);
         Assert.NotNull(value);
         Assert.Equal(testDateTime, value);
     }
     else if (property.PropertyType == typeof(Decimal))
     {
         Decimal value = (Decimal)property.GetValue(contractObject);
         Assert.NotNull(value);
         Assert.Equal(testDecimal, value);
     }
     else if (property.PropertyType == typeof(Int32))
     {
         Int32 value = (Int32)property.GetValue(contractObject);
         Assert.NotNull(value);
         Assert.Equal(testInteger, value);
     }
     else if (property.PropertyType == typeof(Boolean))
     {
         Boolean value = (Boolean)property.GetValue(contractObject);
         Assert.NotNull(value);
         Assert.Equal(testBoolean, value);
     }
     else if (property.PropertyType == typeof(LightHouse.Core.ContractObject))
     {
         LightHouse.Core.ContractObject value = (LightHouse.Core.ContractObject)property.GetValue(contractObject);
         Assert.NotNull(value);
         Assert.Equal(contractObjectID, value.ID);
     }
     else if (property.PropertyType.GetTypeInfo().IsGenericType && (property.PropertyType.GetGenericTypeDefinition() == typeof(IContractList<>)))
     {
         IContractList value = (IContractList)property.GetValue(contractObject);
         Assert.NotNull(value);
     }
 }
    // Use this for initialization
    void Start()
    {
        controller = GetComponent <CharacterController>();

        player = GameObject.FindWithTag("Player");

        //buoyTarget = GameObject.FindGameObjectsWithTag ("Buoy");

        lighthouseScript = player.GetComponent <LightHouse>();

        //originalColor = renderer.material.color;
        //boatLight.renderer.material.color = originalColor;

        //Functions
        BoatInput();
        BoatHealth();
        BuoySearching();

        //BoatLighting();

        StartCoroutine(LevelTitle());
    }
Exemple #3
0
        public MovementLightHouse(LightHouse lighthouse)
        {
            _lightHouse = lighthouse;

            Positions.Add(new Position(-90, new RealPoint(_lightHouse.Position.X, 275)));
        }
        private void SetProperty(LightHouse.Core.ContractObject contractObject, PropertyInfo property)
        {
            if (property.PropertyType == typeof(String))
            {
                property.SetValue(contractObject, testString);
            }
            else if (property.PropertyType == typeof(DateTime))
            {
                property.SetValue(contractObject, testDateTime);
            }
            else if (property.PropertyType == typeof(Decimal))
            {
                property.SetValue(contractObject, testDecimal);
            }
            else if (property.PropertyType == typeof(Int32))
            {
                property.SetValue(contractObject, testInteger);
            }
            else if (property.PropertyType == typeof(Boolean))
            {
                property.SetValue(contractObject, testBoolean);
            }
            else if (property.PropertyType == typeof(LightHouse.Core.ContractObject))
            {
                LightHouse.Core.ContractObject subContractObject = (LightHouse.Core.ContractObject)LightHouse.Elite.Core.Builder.Get(property.PropertyType);
                subContractObject.ID = subContractObjectID;
                property.SetValue(contractObject, subContractObject);
            }
            else if (property.PropertyType.GetTypeInfo().IsGenericType && (property.PropertyType.GetGenericTypeDefinition() == typeof(IContractList<>)))
            {
                Type typeArgument = property.PropertyType.GenericTypeArguments[0];
                Type generic = typeof(ContractList<>);
                Type specific = generic.MakeGenericType(typeArgument);

                IContractList contractList = (IContractList)LightHouse.Elite.Core.Builder.Get(specific);

                property.SetValue(contractObject, contractList);
            }
        }