namespace codelanguage; /// Indentation-only source used by new IDE documents and projects. public static class CodeTemplates { public static string Demo => """ // Craft++ uses indentation to define blocks. Braces are not allowed. // Indent children with four spaces; dedent to finish a block. mob/Player var/health = 100 proc/Greet() world << "Hello from Craft++!" proc/Main() var/mob/Player/player = new /mob/Player() player.Greet() for (var/i = 1; i <= 3; i++) if (i == 2) world << "Middle step" else world << "Step [i]" Main() """; public static string CreateProjectSource(string projectName) { projectName = projectName.Replace("\\", "\\\\").Replace("\"", "\\\"").Replace("\r", " ").Replace("\n", " "); return $@"// {projectName} - Craft++ DM Code // Created: {DateTime.Now} world name = ""{projectName}"" turf icon = ""turf.cpi"" icon_state = """" density = 0 turf/space : turf icon_state = ""space"" turf/floor : turf icon_state = ""floor"" turf/wall : turf icon_state = ""wall"" density = 1 obj/item : obj icon_state = ""item"" obj icon = ""obj.cpi"" icon_state = """" density = 0 mob icon = ""mob.cpi"" icon_state = """" density = 1 mob/player : mob icon_state = ""player"" density = 1 proc/Login() world << ""Welcome, [src.name]!"" return 1 Click() world << ""Clicked at ([src.x],[src.y])"" #include ""map.cpm"" proc/Main() new /mob/player(x = 10, y = 10, z = 1) return 1 "; } }