tzachshabtay / MonoAGS

AGS (Adventure Game Studio) reimagined in Mono
https://tzachshabtay.github.io/MonoAGS/
Artistic License 2.0
27 stars 8 forks source link

Renamed Location to Position and added tuple shortcuts #298

Closed tzachshabtay closed 6 years ago

tzachshabtay commented 6 years ago
  1. Added tuple shortcuts (example below) for a more friendly API possibilties.
  2. Removed the ILocation interface and renamed Location to Position.

So, previous code which looked like this:


obj.Location = new AGSLocation(100, 200);
obj.Scale = new PointF(2, 2);
obj.Pivot = new PointF(0.5f, 0.5f);

var x = obj.Pivot.X;
var y = obj.Pivot.Y;

Can now be written like this:


obj.Position = (100, 200);
obj.Scale = (2, 2);
obj.Pivot = (0.5f, 0.5f);

(var x, var y) = obj.Pivot;
ghost commented 6 years ago

Sorry if dumb question, why was ILocation needed previously anyway?

Oh, nevermind, have read the commit comment.