好的,我的问题是这个
switch (charType) {
case Mush:
switch (charColor) {
case Blue:
switch (charDirec) {
case Left:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.l_blue_m);
break;
case Right:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.r_blue_m);
break;
case Bounce:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.b_blue_m);
break;
case Walk:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.w_blue_m);
break;
}
break;
case Red:
switch (charDirec) {
case Left:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.l_red_m);
break;
case Right:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.r_red_m);
break;
case Bounce:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.b_red_m);
break;
case Walk:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.w_red_m);
break;
}
case Tan:
switch (charDirec) {
case Left:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.l_tan_m);
break;
case Right:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.r_tan_m);
break;
case Bounce:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.b_tan_m);
break;
case Walk:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.w_tan_m);
break;
}
break;
}
break;
case Slime:
switch (charColor) {
case Blue:
switch (charDirec) {
case Left:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.l_blue_s);
break;
case Right:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.r_blue_s);
break;
case Bounce:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.b_blue_s);
break;
case Walk:
bitmap = (Bitmap) BitmapFactory.decodeResource(
mainContext.getResources(), R.drawable.w_blue_s);
break;
}
break;
}
break;
}
有什么更好的方法来处理这个问题?或者这是正确的?