project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/NetplayStateFragment.java
equal
deleted
inserted
replaced
|
1 /* |
|
2 * Hedgewars for Android. An Android port of Hedgewars, a free turn based strategy game |
|
3 * Copyright (C) 2012 Simeon Maxein <smaxein@googlemail.com> |
|
4 * |
|
5 * This program is free software; you can redistribute it and/or |
|
6 * modify it under the terms of the GNU General Public License |
|
7 * as published by the Free Software Foundation; either version 2 |
|
8 * of the License, or (at your option) any later version. |
|
9 * |
|
10 * This program is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 * GNU General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License |
|
16 * along with this program; if not, write to the Free Software |
|
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
18 */ |
|
19 |
1 package org.hedgewars.hedgeroid; |
20 package org.hedgewars.hedgeroid; |
2 |
21 |
3 import org.hedgewars.hedgeroid.R; |
22 import org.hedgewars.hedgeroid.R; |
4 import org.hedgewars.hedgeroid.frontlib.Frontlib; |
23 import org.hedgewars.hedgeroid.frontlib.Frontlib; |
5 import org.hedgewars.hedgeroid.netplay.Netplay; |
24 import org.hedgewars.hedgeroid.netplay.Netplay; |
17 |
36 |
18 /** |
37 /** |
19 * Fragment for use by an activity that depends on the state of the network |
38 * Fragment for use by an activity that depends on the state of the network |
20 * connection. The activity must implement the NetplayStateListener interface. |
39 * connection. The activity must implement the NetplayStateListener interface. |
21 * |
40 * |
22 * This fragment manages a few aspects of the netplay connection: Requesting |
41 * This fragment manages reacting to changes in the networking state by calling |
23 * the network system loop to run at high frequency while the activity is in |
42 * a callback method on the activity. |
24 * the foreground, and reacting to changes in the networking state by calling |
|
25 * a callback method on the activity. |
|
26 */ |
43 */ |
27 public class NetplayStateFragment extends Fragment { |
44 public class NetplayStateFragment extends Fragment { |
28 private Netplay netplay; |
45 private Netplay netplay; |
29 private Context appContext; |
46 private Context appContext; |
30 private LocalBroadcastManager broadcastManager; |
47 private LocalBroadcastManager broadcastManager; |