Merge branch 'master' of github.com:systemed/potlatch2
[potlatch2.git] / net / systemeD / halcyon / connection / actions / ReverseNodesAction.as
1 package net.systemeD.halcyon.connection.actions {
2
3     import net.systemeD.halcyon.connection.*;
4     
5     public class ReverseNodesAction extends UndoableEntityAction {
6     
7         private var nodeList:Array;
8     
9         public function ReverseNodesAction(way:Way, nodeList:Array) {
10             super(way, "Reverse");
11             this.nodeList = nodeList;
12         }
13         
14         public override function doAction():uint {
15             nodeList.reverse();
16             markDirty();
17             entity.dispatchEvent(new EntityEvent(Connection.WAY_REORDERED, entity));
18             return SUCCESS;
19         }
20         
21         public override function undoAction():uint {
22             nodeList.reverse();
23             markClean();
24             entity.dispatchEvent(new EntityEvent(Connection.WAY_REORDERED, entity));
25             return SUCCESS;
26         }
27     }
28 }