Added Polygon Union
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
╨╛o<▐Пр╞╚#'?╪й┌╛'л
|
�zsuɹe��O�u�~�^
|
||||||
@@ -24,9 +24,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
return polygons
|
return polygons
|
||||||
},
|
},
|
||||||
submitFinalCollation(res, gameID, userID, points, mergedPolygonIDs) {
|
submitFinalCollation(res, gameID, userID, points, area, mergedPolygonIDs) {
|
||||||
console.log(module.exports.convertPointsObjToArray(points));
|
|
||||||
let area = mathFunc.calculateArea(points);
|
|
||||||
query = util.format("CALL insertPolygon(\"%s\", \"%s\", %d)", gameID, userID, area);
|
query = util.format("CALL insertPolygon(\"%s\", \"%s\", %d)", gameID, userID, area);
|
||||||
db.get().query(query, function(err, rows) {
|
db.get().query(query, function(err, rows) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -95,7 +93,10 @@ module.exports = {
|
|||||||
polygonResult.push(polygon);
|
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){
|
unionPolygon(points1, points2){
|
||||||
|
|||||||
Reference in New Issue
Block a user