fromJSON method

Vision fromJSON(
  1. Map<String, dynamic> json
)

Restores this instance from the given JSON object.

Implementation

Vision fromJSON(Map<String,dynamic> json ) {
	owner = json['owner'];
	fieldOfView = json['fieldOfView'];
	range = double.parse( json['range'] );

	for ( int i = 0, l = json['obstacles'].length; i < l; i ++ ) {
		final obstacle = json['obstacles'][ i ];
		obstacles.add( obstacle );
	}

	return this;
}