コード例 #1
0
    // PRIVATE
    ///<summary>
    ///	DEMO
    //
    ///</summary>
    private void _doDemoOfGenericClassWithWhere()
    {
        // DECLARE
        ShotGenericClassWithWhere <BigShotAmount> stringShotGenericClassWithWhere = new ShotGenericClassWithWhere <BigShotAmount> (new BigShotAmount(99.99f));          //TODO: I. Try to pass type <> other than string or float Compiler purposefully gives an error.

        // USE
        stringShotGenericClassWithWhere.updateInternalStorage(new BigShotAmount(499.99f));
        Debug.Log("	stringShotGenericClassWithWhere: " + stringShotGenericClassWithWhere.millilitersDrank);
    }
コード例 #2
0
	// PRIVATE
	///<summary>
	///	DEMO
	//
	///</summary>
	private void _doDemoOfGenericClassWithWhere () 
	{
		// DECLARE
		ShotGenericClassWithWhere<BigShotAmount> stringShotGenericClassWithWhere = new ShotGenericClassWithWhere<BigShotAmount> ( new BigShotAmount( 99.99f) ); //TODO: I. Try to pass type <> other than string or float Compiler purposefully gives an error.
		
		// USE
		stringShotGenericClassWithWhere.updateInternalStorage ( new BigShotAmount ( 499.99f));
		Debug.Log ("	stringShotGenericClassWithWhere: " + stringShotGenericClassWithWhere.millilitersDrank);
		
	}