Add ioOp functions for Point and Bounds
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user