#ifndef AR_SHOP_LUAGRAPH_H
#define AR_SHOP_LUAGRAPH_H

extern "C" {
#include "lua.h"
}

#include <vector>

class Node {
public:
  int mVertex;
  float mWeight;

  Node(int v, float w) {
    mVertex = v;
    mWeight = w;
  }

  bool operator<(const Node &rhs) const {
    return mWeight < rhs.mWeight;
  }

  bool operator>(const Node &rhs) const {
    return rhs < *this;
  }

  bool operator<=(const Node &rhs) const {
    return !(rhs < *this);
  }

  bool operator>=(const Node &rhs) const {
    return !(*this < rhs);
  }
};

struct Graph {
  std::vector<std::vector<Node>> vector;
};

int createGraph(lua_State *L);

int deleteGraph(lua_State *L);

int setAdjWeight(lua_State *L);

int buildRoute(lua_State *L);

int connect(lua_State *L);

int getAdj(lua_State *L);

int expandTo(lua_State *L);

int getAdjCount(lua_State *L);

#endif //AR_SHOP_LUAGRAPH_H
