Now realized drawing several spots in first, and then arbitrarily connected the two points and also realize the function of undo and remaking, but when I draw point is inside the point coordinates are stored in the set, I withdraw or remaking of the time how to implement collection also corresponding to delete or add some?
CodePudding user response:
Collection is not remove and add method
CodePudding user response:
reference 1st floor Bridge_go response: collection is not to have the add and remove methods but how do I know if I cancel the line or point ah, cancel the line I don't need to operate, cancel the point I just need to modify the collection CodePudding user response:
You undo function is not good, you don't know to cancel??????? CodePudding user response:
Online code, The Class void Main () { List The RAS=new List () If (you draw something) { RecentAction RA=new RecentAction () RA.=Xx Xx; RA. Yy=Yy; RA. The add (RA) } } The Class RecentAction () { ActionType at {get; The set; } List Point the {get; The set; } } Enum ActionType { Line, Point, And more... } CodePudding user response:
When you withdraw from RecentAction find something you want to delete, there are you need to sync delete data in the collection, CodePudding user response:
Use a stack, recording all your operation time, and then do inverse operation, CodePudding user response:
Look at the command mode, specially designed for revocation of redo custom mode CodePudding user response:
refer to the second floor small 2 rogue response: Quote: refer to 1st floor Bridge_go response: Collection is not to have the add and remove methods but how do I know if I cancel the line or point ah, cancel the line I don't need to operate, cancel the point I just need to modify the collection In the process to add an attribute that you draw record is draw point or line, so you will know that you are to cancel the line or point, CodePudding user response:
Not delete points, point in the region of the map are the x, y, in the collection are also have x, y, the two have not found the same, can find can not deleted?