예제 #1
0
    public bool GetTerrain(string[] arr)
    {
        string errorMessage1 = "GetTerrain {g|f|r|b|w}";
        string errorMessage2 = "    {friction|bounce|lieRate|lieRange}";

        if (arr.Length == 2)
        {
            TerrainType terrainType = game.GetTerrainAttributes().GetTerrainType(arr[0].ToUpper());
            switch (arr[1].ToLower())
            {
            case "friction":
                Reply(terrainType.GetFriction().ToString());
                break;

            case "bounce":
                Reply(terrainType.GetBounce().ToString());
                break;

            case "lierate":
                Reply(terrainType.GetLieRate().ToString());
                break;

            case "lierange":
                Reply(terrainType.GetLieRange().ToString());
                break;

            default:
                Reply(errorMessage1);
                Reply(errorMessage2);
                break;
            }
            return(true);
        }
        Reply(errorMessage1);
        Reply(errorMessage2);
        return(true);
    }