Commit af67d087 authored by Chinmay Garde's avatar Chinmay Garde

Minor: Add result types for known failure cases

parent 530700a8
......@@ -14,3 +14,4 @@ part 'solver.dart';
part 'symbol.dart';
part 'row.dart';
part 'utils.dart';
part 'result.dart';
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of cassowary;
class Result {
final bool error;
final String message;
const Result(this.message, this.error);
static final Result success = const Result("Success", false);
static final Result unimplemented = const Result("Unimplemented", true);
static final Result duplicateConstraint =
const Result("Duplicate Constraint", true);
static final Result unsatisfiableConstraint =
const Result("Unsatisfiable Constraint", true);
static final Result unknownConstraint =
const Result("Unknown Constraint", true);
static final Result duplicateEditVariable =
const Result("Duplicate Edit Variable", true);
static final Result badRequiredStrength =
const Result("Bad Required Strength", true);
static final Result unknownEditVariable =
const Result("Unknown Edit Variable", true);
static final Result internalSolverError =
const Result("Internal Solver Error", true);
}
......@@ -13,32 +13,32 @@ class Solver {
final Row _objective = new Row();
final Row _artificial = new Row();
bool addConstraint(Constraint c) {
return false;
Result addConstraint(Constraint c) {
return Result.unimplemented;
}
bool removeContraint(Constraint c) {
return false;
Result removeContraint(Constraint c) {
return Result.unimplemented;
}
bool hasConstraint(Constraint c) {
return false;
Result hasConstraint(Constraint c) {
return Result.unimplemented;
}
bool addEditVariable(Variable v, double priority) {
return false;
Result addEditVariable(Variable v, double priority) {
return Result.unimplemented;
}
bool removeEditVariable(Variable v) {
return false;
Result removeEditVariable(Variable v) {
return Result.unimplemented;
}
bool hasEditVariable(Variable v) {
return false;
Result hasEditVariable(Variable v) {
return Result.unimplemented;
}
bool suggestVariable(Variable v, double value) {
return false;
Result suggestVariable(Variable v, double value) {
return Result.unimplemented;
}
void updateVariable() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment