Preserve Entity immutability

Reintroduced an Entity class. Entity mutations will be
expressed as methods that return a new Entity.

Extract a move operation from the drag behavior. Instead
of updating an entity in place, the drag event produces
a new entity and graph and replaces the current history
version, which was created by doing a noop on dragstart.

pdata is no longer used. It was previously removed from
Graph, and I think it makes more sense to have a specialized
Entity class as well.
This commit is contained in:
John Firebaugh
2012-11-09 18:36:18 -08:00
parent b3f3d0eff4
commit 3b8d640cfb
9 changed files with 64 additions and 85 deletions
+1 -1
View File
@@ -53,7 +53,7 @@
<script type='text/javascript' src='js/iD/format/GeoJSON.js'></script>
<script type='text/javascript' src='js/iD/format/XML.js'></script>
<script type='text/javascript' src='js/iD/graph/pdata.js'></script>
<script type='text/javascript' src='js/iD/graph/Entity.js'></script>
<script type='text/javascript' src='js/iD/graph/Node.js'></script>
<script type='text/javascript' src='js/iD/graph/Relation.js'></script>
<script type='text/javascript' src='js/iD/graph/Way.js'></script>