📄 paddleconfig.java
字号:
public class PaddleConfig {
int id;
int bouncerule;
static final int BOUNCERULE_SIMPLE=0;
static final int BOUNCERULE_TRAVEL=1;
double travel=0;
int shape;
static final int SHAPE_FLAT=0;
double shape_width;
double shape_height;
double spring=0;
String wall[];
public PaddleConfig()
{
}
public void processPaddle(String input)
{
int j;
String _paddle[] = ConfigStorage.count(input,0,',');
for(int i=0;i<_paddle.length;i++)
{
String _paddle_conf[]=ConfigStorage.count(_paddle[i],0,'=');
String items[] = ConfigStorage.count(_paddle_conf[1],0,'/');
if( _paddle_conf[0].compareTo("player")==0)
{
id=java.lang.Integer.parseInt(items[0]);
}
else if(_paddle_conf[0].compareTo("bouncerule")==0)
{
if(items[0].compareTo("travel")==0)
{
bouncerule=BOUNCERULE_TRAVEL;
travel=java.lang.Double.parseDouble(items[1]);
}
else if(items[0].compareTo("simple")==0)
{
bouncerule=BOUNCERULE_SIMPLE;
}
}
else if(_paddle_conf[0].compareTo("shape")==0)
{
shape_width=java.lang.Double.parseDouble(items[1]);
shape_height=java.lang.Double.parseDouble(items[2]);
if(items[0].compareTo("flat")==0)
{
shape=SHAPE_FLAT;
}
}
else if(_paddle_conf[0].compareTo("spring")==0)
{
spring = java.lang.Double.parseDouble(_paddle_conf[1]);
}
else if(_paddle_conf[0].compareTo("wall")==0)
{
wall=new String[items.length];
for(j=0;j<wall.length;j++)
{
wall[j]=items[j];
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -