#pragma once #include #include "oxygine-framework.h" #include #include "Jewel.h" using namespace oxygine; DECLARE_SMART(Jewel, spJewel); struct space { Point pos; spJewel jewel; }; class Board { public: Board(); void init(int w, int h); void free(); spActor getView(); private: space* getSpace(const Point& pos, bool check = true); void update(const UpdateState& us); spTween swap(space& a, space& b); void touched(Event*); void swapped(Event*); void findMatches(std::vector& spaces, space& sp); void findMatches(std::vector& spaces, space& sp, const Point& dir); spSprite _view; space* _selected; spTween _current; std::vector _field; Point _size; };