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

        if (arr.Length == 3)
        {
            TerrainType terrainType = game.GetTerrainAttributes().GetTerrainType(arr[0].ToUpper());
            float       n           = Floatify(arr[2]);
            switch (arr[1].ToLower())
            {
            case "friction":
                terrainType.SetFriction(n);
                break;

            case "bounce":
                terrainType.SetBounce(n);
                break;

            case "lierate":
                terrainType.SetLieRate(n);
                break;

            case "lierange":
                terrainType.SetLieRange(n);
                break;

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