Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package net.pixvi.myr.center
|
||||
{
|
||||
import net.pixvi.myrloader.center.MyrCenter;
|
||||
|
||||
public class GameTools
|
||||
{
|
||||
|
||||
public static var words:Array;
|
||||
|
||||
public static var chars:String = " ,<>.{}[]-_=+`~/?!@#$%^&*|\\/\"\';:";
|
||||
|
||||
public function GameTools()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function checkWord(str:String) : String
|
||||
{
|
||||
var i:int = 0;
|
||||
if(MyrCenter.lang == "JP")
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var len:int = int(words.length);
|
||||
for(i = 0; i < len; )
|
||||
{
|
||||
if(str.indexOf(words[i]) != -1)
|
||||
{
|
||||
return words[i];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function checkChar(str:String) : String
|
||||
{
|
||||
var i:int = 0;
|
||||
if(chars == null || chars.length <= 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var len:int = str.length;
|
||||
for(i = 0; i < len; )
|
||||
{
|
||||
if(chars.indexOf(str.charAt(i)) != -1)
|
||||
{
|
||||
return str.charAt(i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user