|
|
|
|
@ -24,9 +24,7 @@ module.exports = {
|
|
|
|
|
}
|
|
|
|
|
return polygons
|
|
|
|
|
},
|
|
|
|
|
submitFinalCollation(res, gameID, userID, points, mergedPolygonIDs) {
|
|
|
|
|
console.log(module.exports.convertPointsObjToArray(points));
|
|
|
|
|
let area = mathFunc.calculateArea(points);
|
|
|
|
|
submitFinalCollation(res, gameID, userID, points, area, mergedPolygonIDs) {
|
|
|
|
|
query = util.format("CALL insertPolygon(\"%s\", \"%s\", %d)", gameID, userID, area);
|
|
|
|
|
db.get().query(query, function(err, rows) {
|
|
|
|
|
if (err) {
|
|
|
|
|
@ -95,7 +93,10 @@ module.exports = {
|
|
|
|
|
polygonResult.push(polygon);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
module.exports.submitFinalCollation(res, gameID, userID, polygonPoints, polygonsMerged);
|
|
|
|
|
|
|
|
|
|
let area = mathFunc.calculateArea(points);
|
|
|
|
|
module.exports.polygonDestruction(res, gameID, userID, polygonPoints, area, polygonsMerged);
|
|
|
|
|
module.exports.submitFinalCollation(res, gameID, userID, polygonPoints, area, polygonsMerged);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
unionPolygon(points1, points2){
|
|
|
|
|
|