Coverage Summary for Class: ModelUpdateEvent (it.polimi.ingsw.Server.Messages.Events.Internal)
Class |
Class, %
|
Method, %
|
Line, %
|
ModelUpdateEvent |
100%
(1/1)
|
50%
(1/2)
|
66,7%
(2/3)
|
1 package it.polimi.ingsw.Server.Messages.Events.Internal;
2
3 import it.polimi.ingsw.Model.Model;
4 import it.polimi.ingsw.Model.ModelWrapper;
5 import it.polimi.ingsw.Server.Messages.Events.ClientEvent;
6
7 /**
8 * This Event is generated by {@link it.polimi.ingsw.Model.ModelWrapper} upon usage of
9 * {@link it.polimi.ingsw.Model.ModelWrapper#editModel(ModelWrapper.ModelModifier, boolean)}.
10 * This event contains a copy of the updated model, and is distributed to all players in a lobby
11 */
12 public class ModelUpdateEvent implements ClientEvent {
13 private final Model update;
14
15 /**
16 * Ship an updated model as an event
17 *
18 * @param update reference to the updated model
19 */
20 public ModelUpdateEvent(Model update) {
21 this.update = update;
22 }
23
24 /**
25 * Get the {@link Model} object
26 *
27 * @return a reference to the stored {@link Model}
28 */
29 public Model getModel() {
30 return update;
31 }
32 }