public void cancel() { if(state == tradeStateType.pending) { state = tradeStateType.canceled; TradeDAO.currentInstance.save(this); } }
public void execute() { if(state == tradeStateType.pending) { string auxiliar = pictureA.getOwner(); pictureA.setOwner(pictureB.getOwner()); pictureB.setOwner(auxiliar); state = tradeStateType.completed; TradeDAO.currentInstance.save(this); } }
public Trade(Picture imgA,Picture imgB) { this.pictureA = imgA; this.pictureB = imgB; state = tradeStateType.pending; }