JSONObject.GetField C# (CSharp) Method

GetField() public method

public GetField ( string name, GetFieldResponse response, FieldNotFound fail = null ) : void
name string
response GetFieldResponse
fail FieldNotFound
return void
	public void GetField(string name, GetFieldResponse response, FieldNotFound fail = null)
	{
		if (response != null && type == Type.OBJECT)
		{
			int index = keys.IndexOf(name);
			if (index >= 0)
			{
				response.Invoke(list[index]);
				return;
			}
		}
		if (fail != null) fail.Invoke(name);
	}
	public JSONObject GetField(string name)

Same methods

JSONObject::GetField ( string name ) : JSONObject,
JSONObject::GetField ( bool &field, string name, FieldNotFound fail = null ) : void
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 &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