JSONObject.GetField C# (CSharp) Method

GetField() public method

public GetField ( bool &field, string name, FieldNotFound fail = null ) : void
field bool
name string
fail FieldNotFound
return void
	public void GetField(ref bool field, string name, FieldNotFound fail = null)
	{
		if (type == Type.OBJECT)
		{
			int index = keys.IndexOf(name);
			if (index >= 0)
			{
				field = list[index].b;
				return;
			}
		}
		if (fail != null) fail.Invoke(name);
	}
#if USEFLOAT

Same methods

JSONObject::GetField ( string name ) : JSONObject,
JSONObject::GetField ( double &field, string name, FieldNotFound fail = null ) : void
JSONObject::GetField ( float &field, string name, FieldNotFound fail = null ) : void
JSONObject::GetField ( int &field, string name, FieldNotFound fail = null ) : void
JSONObject::GetField ( string name, GetFieldResponse response, FieldNotFound fail = null ) : void
JSONObject::GetField ( string &field, string name, FieldNotFound fail = null ) : void
JSONObject::GetField ( uint &field, string name, FieldNotFound fail = null ) : void

Usage Example

 public MovementDown(JSONObject js) : base()
 {
     _id = (int)js.GetField(js.keys[0]).n;
     _movement = (int)js.GetField(js.keys[1]).n;
     NbTurn = (int)js.GetField("nbTurn").n;
     ApplyReverseEffect = true;
 }
All Usage Examples Of JSONObject::GetField