Add ioOp functions for Point and Bounds

This commit is contained in:
2017-10-12 16:09:36 -05:00
parent 507c894c15
commit 9c2e71045f
13 changed files with 136 additions and 65 deletions
+14 -2
View File
@@ -5,15 +5,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <ox/std/types.hpp>
namespace nostalgia {
namespace common {
class Point {
public:
int X = 0;
int Y = 0;
int x = 0;
int y = 0;
Point();
@@ -55,5 +58,14 @@ class Point {
Point operator/=(int i);
};
template<typename T>
ox::Error ioOp(T *io, Point *obj) {
ox::Error err = 0;
io->setFields(2);
err |= io->op("x", &obj->x);
err |= io->op("y", &obj->y);
return err;
}
}
}