v0.3.4: moved some functionality from Utils in prep for removing it.

This commit is contained in:
Evan Debenham
2016-01-26 15:08:41 -05:00
parent 17bb42f7f7
commit d9d6e45d04
14 changed files with 103 additions and 109 deletions
@@ -20,9 +20,9 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.utils;
import com.watabou.utils.Signal;
import android.util.Log;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.utils.Signal;
public class GLog {
@@ -38,7 +38,7 @@ public class GLog {
public static void i( String text, Object... args ) {
if (args.length > 0) {
text = Utils.format( text, args );
text = Messages.format( text, args );
}
Log.i( TAG, text );
@@ -20,25 +20,10 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.utils;
import java.util.Locale;
public class Utils {
public static String capitalize( String str ) {
return Character.toUpperCase( str.charAt( 0 ) ) + str.substring( 1 );
}
public static String format( String format, Object...args ) {
return String.format( Locale.ENGLISH, format, args );
}
public static String VOWELS = "aoeiu";
public static String indefinite( String noun ) {
if (noun.length() == 0) {
return "a";
} else {
return (VOWELS.indexOf( Character.toLowerCase( noun.charAt( 0 ) ) ) != -1 ? "an " : "a ") + noun;
}
}
}