Skip to content

Commit

Permalink
Small refactor of class Rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexLiogky committed May 22, 2017
1 parent 1248439 commit 6778d16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 8 additions & 0 deletions application/src/main/java/org/test/ui/Rooms.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
import java.util.Map;

public class Rooms {
private static Rooms ourInstance = new Rooms();
public static Rooms getInstance() {
return ourInstance;
}
private Rooms(){

}

private Map<Key, Room> rooms = new HashMap<Key, Room>();

private Room newRoom(com.vaadin.ui.UI ui, long password){
Expand Down
7 changes: 3 additions & 4 deletions application/src/main/java/org/test/ui/UI.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.test.ui;


import com.vaadin.annotations.Push;
import com.vaadin.server.ThemeResource;
import com.vaadin.shared.MouseEventDetails;
Expand All @@ -8,22 +9,20 @@
import com.vaadin.ui.themes.ValoTheme;
import org.test.Canvas;


import javax.servlet.annotation.WebServlet;;
import javax.servlet.annotation.WebServlet;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.VerticalLayout;

@Theme("demo")
@SuppressWarnings("serial")
@Push
public class UI extends com.vaadin.ui.UI
{
private static Rooms rooms = new Rooms();
private static Rooms rooms = Rooms.getInstance();

@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = UI.class)
Expand Down
2 changes: 0 additions & 2 deletions canv-addon/src/main/java/org/test/client/item/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public class Item implements Serializable, Blockable{
protected String color;

public Item () {
change();
id = identity++;
}

public Item(int x_max, int y_max, int x_min, int y_min) {
Expand Down

0 comments on commit 6778d16

Please sign in to comment.