-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mikhail Mukovnikov
committed
Jan 7, 2014
0 parents
commit a0e6265
Showing
193 changed files
with
28,323 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry including="**/*.java" kind="src" path="src/main/java"/> | ||
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="lib" path="lib/bsh-2.04b.jar"/> | ||
<classpathentry kind="lib" path="lib/gluegen-rt-1.0b5.jar"/> | ||
<classpathentry kind="lib" path="lib/jogl-1.1.1.jar"/> | ||
<classpathentry kind="lib" path="lib/vorbisspi-1.03.jar"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Binary file added
BIN
+57 Bytes
.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index
Binary file not shown.
1 change: 1 addition & 0 deletions
1
.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Binary file not shown.
Binary file added
BIN
+436 Bytes
.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
version=1 |
13 changes: 13 additions & 0 deletions
13
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
content_assist_proposals_background=255,255,255 | ||
content_assist_proposals_foreground=0,0,0 | ||
eclipse.preferences.version=1 | ||
fontPropagated=true | ||
org.eclipse.jdt.ui.editor.tab.width= | ||
org.eclipse.jdt.ui.formatterprofiles.version=12 | ||
org.eclipse.jdt.ui.javadoclocations.migrated=true | ||
org.eclipse.jface.textfont=1|Monaco|11.0|0|COCOA|1|; | ||
proposalOrderMigrated=true | ||
spelling_locale_initialized=true | ||
tabWidthPropagated=true | ||
useAnnotationsPrefPage=true | ||
useQuickDiffPrefPage=true |
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.m2e.discovery.pref.projects= |
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
mylyn.attention.migrated=true |
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true |
3 changes: 3 additions & 0 deletions
3
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.mylyn.tasks.ui.filters.nonmatching=true | ||
org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true |
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
pref_first_startup=false |
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.team.ui.first_time=false |
5 changes: 5 additions & 0 deletions
5
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PROBLEMS_FILTERS_MIGRATE=true | ||
eclipse.preferences.version=1 | ||
platformState=1382269882199 | ||
quickStart=false | ||
tipsAndTricks=true |
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
showIntro=false |
3 changes: 3 additions & 0 deletions
3
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ENABLED_DECORATORS=org.eclipse.m2e.core.mavenVersionDecorator\:false,org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator\:true,org.eclipse.jdt.ui.override.decorator\:true,org.eclipse.jdt.ui.interface.decorator\:false,org.eclipse.jdt.ui.buildpath.decorator\:true,org.eclipse.m2e.core.maven2decorator\:true,org.eclipse.mylyn.context.ui.decorator.interest\:true,org.eclipse.mylyn.tasks.ui.decorators.task\:true,org.eclipse.mylyn.team.ui.changeset.decorator\:true,org.eclipse.team.cvs.ui.decorator\:true,org.eclipse.ui.LinkedResourceDecorator\:true,org.eclipse.ui.SymlinkDecorator\:true,org.eclipse.ui.VirtualResourceDecorator\:true,org.eclipse.ui.ContentTypeDecorator\:true,org.eclipse.ui.ResourceFilterDecorator\:false, | ||
PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery; | ||
eclipse.preferences.version=1 |
2,209 changes: 2,209 additions & 0 deletions
2,209
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<typeInfoHistroy/> |
2 changes: 2 additions & 0 deletions
2
.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<qualifiedTypeNameHistroy/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<section name="Workbench"> | ||
<section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart"> | ||
<item value="true" key="group_libraries"/> | ||
<item value="false" key="linkWithEditor"/> | ||
<item value="2" key="layout"/> | ||
<item value="1" key="rootMode"/> | ||
<item value="<?xml version="1.0" encoding="UTF-8"?>
<packageExplorer group_libraries="1" layout="2" linkWithEditor="0" rootMode="1" workingSetName="">
<customFilters userDefinedPatternsEnabled="false">
<xmlDefinedFilters>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.LibraryFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.LocalTypesFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.StaticsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ClosedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonSharedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonJavaElementFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ContainedLibraryFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.CuAndClassFileFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonJavaProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.FieldsFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.NonPublicFilter" isEnabled="false"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter" isEnabled="true"/>
<child filterId="org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter" isEnabled="true"/>
<child filterId="org.eclipse.mylyn.java.ui.MembersFilter" isEnabled="false"/>
<child filterId="org.eclipse.m2e.MavenModuleFilter" isEnabled="false"/>
</xmlDefinedFilters>
</customFilters>
</packageExplorer>" key="memento"/> | ||
</section> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<section name="Workbench"> | ||
<section name="ExternalProjectImportWizard"> | ||
<item value="false" key="WizardProjectsImportPage.STORE_ARCHIVE_SELECTED"/> | ||
<item value="false" key="WizardProjectsImportPage.STORE_COPY_PROJECT_ID"/> | ||
<item value="false" key="WizardProjectsImportPage.STORE_NESTED_PROJECTS"/> | ||
<list key="WizardProjectsImportPage.STORE_DIRECTORIES"> | ||
<item value="/Users/mix_mix/Documents/quantum"/> | ||
</list> | ||
<list key="WizardProjectsImportPage.STORE_ARCHIVES"> | ||
<item value=""/> | ||
</list> | ||
</section> | ||
</section> |
17 changes: 17 additions & 0 deletions
17
.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<section name="Workbench"> | ||
<section name="org.eclipse.ui.internal.QuickAccess"> | ||
<item value="900" key="dialogWidth"/> | ||
<item value="563" key="dialogHeight"/> | ||
<list key="orderedProviders"> | ||
</list> | ||
<list key="textArray"> | ||
</list> | ||
<list key="orderedElements"> | ||
</list> | ||
<list key="textEntries"> | ||
</list> | ||
</section> | ||
<section name="ImportExportAction"> | ||
</section> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<workingSetManager> | ||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1382270050527_0" label="Window Working Set" name="Aggregate for window 1382270050526"/> | ||
</workingSetManager> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.eclipse.core.runtime=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Quantum</name> | ||
<comment>Dyson clone in Java. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> | ||
<projects/> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
player2 | ||
10.0.1.3 | ||
7777 | ||
1014 | ||
878 | ||
363 | ||
22 | ||
0.0 | ||
0.75 | ||
0.75 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
update( ) | ||
{ | ||
for( planet: simulation.getPlanets() ) | ||
{ | ||
if( simulation.isOwnedPlanet( planet ) == false ) | ||
continue; | ||
|
||
if( simulation.isOwnedPlanet( planet ) && | ||
simulation.numberOfTrees( planet ) < 2 && | ||
simulation.numberOfFriendlyCreatures( planet ) >= 10 && | ||
simulation.numberOfEnemyCreatures( planet ) == 0 ) | ||
{ | ||
simulation.plantTree( planet ); | ||
continue; | ||
} | ||
|
||
|
||
if( simulation.numberAvailableResources( planet ) == 0 || simulation.creatureLimitReached() || simulation.numberOfFriendlyCreatures( planet ) > 200 ) | ||
{ | ||
simulation.moveCreatures( planet, simulation.getNearestNeighbourToEnemy( planet ), simulation.numberOfFriendlyCreatures( planet ) ); | ||
continue; | ||
} | ||
|
||
if( simulation.numberOfFriendlyCreatures( planet ) != 0 ) | ||
{ | ||
for( neighbour: simulation.getPlanetNeighbours(planet) ) | ||
{ | ||
if( ( simulation.isEnemyPlanet(neighbour) && simulation.numberOfEnemyCreatures( neighbour ) < simulation.numberOfFriendlyCreatures( planet ) ) || | ||
( simulation.isOwnedPlanet(neighbour) && simulation.numberOfEnemyCreatures( neighbour ) > 0 && simulation.numberOfEnemyCreatures( neighbour ) < simulation.numberOfFriendlyCreatures( planet ) ) ) | ||
{ | ||
simulation.moveCreatures( planet, neighbour, simulation.numberOfFriendlyCreatures( planet ) ); | ||
break; | ||
} | ||
|
||
if( simulation.isFreePlanet( neighbour ) && simulation.numberOfMoveableCreatures( planet ) >= 25 && !simulation.hasCreatureMovingTo( planet, neighbour ) ) | ||
{ | ||
simulation.moveCreatures( planet, neighbour, simulation.numberOfFriendlyCreatures( planet ) * 0.25 ); | ||
break; | ||
} | ||
|
||
if( simulation.isOwnedPlanet( neighbour ) && simulation.numberOfTrees( neighbour ) == 0 && simulation.numberOfFriendlyCreatures( neighbour ) < 10 && simulation.numberOfFriendlyCreatures( neighbour )+simulation.numberOfMoveableCreatures( planet ) > 10 ) | ||
{ | ||
simulation.moveCreatures( planet, neighbour, 10 - simulation.numberOfFriendlyCreatures( neighbour ) ); | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
java -Xmx256M -Djava.library.path=./lib -cp quantum.jar quantum.Quantum | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
// | ||
// Copyright (c) 2009 Mario Zechner. | ||
// All rights reserved. This program and the accompanying materials | ||
// are made available under the terms of the GNU Lesser Public License v2.1 | ||
// which accompanies this distribution, and is available at | ||
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | ||
// | ||
// Contributors: | ||
// Mario Zechner - initial API and implementation | ||
// | ||
package quantum; | ||
|
||
import java.awt.Rectangle; | ||
import java.io.BufferedReader; | ||
import java.io.BufferedWriter; | ||
import java.io.File; | ||
import java.io.InputStreamReader; | ||
import java.io.OutputStreamWriter; | ||
|
||
import quantum.utils.FileManager; | ||
|
||
public class Config | ||
{ | ||
String last_name = ""; | ||
String last_ip = ""; | ||
String last_port = ""; | ||
int last_x; | ||
int last_y; | ||
int last_width; | ||
int last_height; | ||
float last_delay; | ||
float volume_music; | ||
float volume_sfx; | ||
|
||
public Config( ) | ||
{ | ||
read( ); | ||
} | ||
|
||
private void read( ) | ||
{ | ||
this.last_name = ""; | ||
this.last_ip = ""; | ||
this.last_port = ""; | ||
this.last_width = 921; | ||
this.last_height= 856; | ||
this.last_x = 0; | ||
this.last_y = 0; | ||
this.volume_music = 0.75f; | ||
this.volume_sfx = 0.75f; | ||
|
||
File file = FileManager.newFile( "config.dat" ); | ||
if( file.exists() == false ) | ||
return; | ||
|
||
try { | ||
BufferedReader reader = new BufferedReader( new InputStreamReader( FileManager.readFile( file ) ) ); | ||
String name = reader.readLine(); | ||
String ip = reader.readLine(); | ||
String port = reader.readLine(); | ||
this.last_name = name; | ||
this.last_ip = ip; | ||
this.last_port = port; | ||
this.last_width = Integer.parseInt( reader.readLine() ); | ||
this.last_height = Integer.parseInt( reader.readLine() ); | ||
this.last_x = Integer.parseInt( reader.readLine() ); | ||
this.last_y = Integer.parseInt( reader.readLine() ); | ||
this.last_delay = Float.parseFloat( reader.readLine() ); | ||
this.volume_music = Float.parseFloat( reader.readLine() ); | ||
this.volume_sfx = Float.parseFloat( reader.readLine() ); | ||
reader.close(); | ||
|
||
} catch (Exception e) | ||
{ | ||
this.last_name = ""; | ||
this.last_ip = ""; | ||
this.last_port = ""; | ||
this.last_width = 921; | ||
this.last_height= 856; | ||
this.last_x = 0; | ||
this.last_y = 0; | ||
this.last_delay = 0.2f; | ||
} | ||
} | ||
|
||
protected void write( Rectangle window_bounds ) | ||
{ | ||
try { | ||
BufferedWriter writer = new BufferedWriter( new OutputStreamWriter( FileManager.writeFile( "config.dat" ) ) ); | ||
writer.write( last_name + "\n" ); | ||
writer.write( last_ip + "\n" ); | ||
writer.write( last_port + "\n" ); | ||
Rectangle bounds = window_bounds; | ||
writer.write( bounds.width + "\n" ); | ||
writer.write( bounds.height + "\n" ); | ||
writer.write( bounds.getBounds().x + "\n" ); | ||
writer.write( bounds.getBounds().y + "\n" ); | ||
writer.write( last_delay + "\n" ); | ||
writer.write( volume_music + "\n" ); | ||
writer.write( volume_sfx + "\n" ); | ||
writer.close(); | ||
|
||
} catch (Exception e) | ||
{ | ||
} | ||
} | ||
|
||
public String getName( ) | ||
{ | ||
return last_name; | ||
} | ||
|
||
public String getIp( ) | ||
{ | ||
return last_ip; | ||
} | ||
|
||
public String getPort( ) | ||
{ | ||
return last_port; | ||
} | ||
|
||
public int getWidth( ) | ||
{ | ||
return last_width; | ||
} | ||
|
||
public int getHeight( ) | ||
{ | ||
return last_height; | ||
} | ||
|
||
public int getX( ) | ||
{ | ||
return last_x; | ||
} | ||
|
||
public int getY( ) | ||
{ | ||
return last_y; | ||
} | ||
|
||
public float getDelay( ) | ||
{ | ||
return last_delay; | ||
} | ||
|
||
public void setName( String name ) | ||
{ | ||
last_name = name; | ||
} | ||
|
||
public void setIp( String ip ) | ||
{ | ||
last_ip = ip; | ||
} | ||
|
||
public void setPort( String port ) | ||
{ | ||
last_port = port; | ||
} | ||
|
||
public void setDelay( float delay ) | ||
{ | ||
last_delay = delay; | ||
} | ||
|
||
public float getVolumeMusic( ) | ||
{ | ||
return volume_music; | ||
} | ||
|
||
public float getVolumeSfx( ) | ||
{ | ||
return volume_sfx; | ||
} | ||
|
||
public void setVolumeMusic( float music ) | ||
{ | ||
volume_music = music; | ||
} | ||
|
||
public void setVolumeSfx( float sfx ) | ||
{ | ||
volume_sfx = sfx; | ||
} | ||
} |
Oops, something went wrong.