annotate Ristipolku.java @ 138:9eb791e2fa17

Optimize board updating logic, so that the old placed tiles need not to be redrawn from scratch on each screen update, as they do not change usually.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 25 Nov 2011 11:04:09 +0200
parents 6f483536a063
children 64b04c0eccce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * Ristipolku
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * (C) Copyright 2011 Matti 'ccr' Hämäläinen <ccr@tnsp.org>
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 *
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 * Ohjelmointiprojekti 2010-2011 Java-kurssille T740306.
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 */
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 import javax.swing.*;
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 import game.*;
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 public class Ristipolku extends JApplet
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 {
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 Engine panel;
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 public void init()
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 {
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 panel = new Engine();
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 getContentPane().add(panel);
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 }
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 public void start()
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 {
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 panel.startThreads();
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 }
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 public void stop()
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 {
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 panel.stopThreads();
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 }
6f483536a063 Added main applet code.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 }