From 03b8688f1e939eba1e835d198df17a01b8d7d0b1 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Fri, 17 Jan 2020 12:15:56 -0500 Subject: [PATCH] World: use single multi-line string instead of a string[] GitOrigin-RevId: 38c0745c95e2341a1a2712d480f6403a6ec68ecf --- Shared/World.cs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Shared/World.cs b/Shared/World.cs index 1a3ce07..49366b9 100644 --- a/Shared/World.cs +++ b/Shared/World.cs @@ -91,26 +91,26 @@ namespace SemiColinGames { public int Width { get; } public int Height { get; } - string[] worldDesc = new string[] { -" ", -" ", -" ", -" ", -" ", -" X ", -" . ", -" X <======> <==X X <=> XX . ", -" XXX . ", -" XXXX . ", -" XXXXX . ", -" X <> <> = <> X X X X <> X X XX X <=X> XXXXXX . ", -" <> [] [] XX XX XXX XX XXXXXXX . ", -" <> [] [] [] XXX XXX XXXX XXX <> <> XXXXXXXX ", -" []12345678[]123456[]123456789[]1234567890 123456 123456 12345 1234 12345 1234 123XXXX XXXX1234XXXXX XXXX1234[]123 1234567[]XXXXXXXXX12345678 ", -"===========================..========..======..=========..=========> <=============> <==============================================================> <=======..==============..==============================", -"...................................................................] [.............] [..............................................................] [......................................................." }; + string worldString = @" + + + + + X + . + X <======> <==X X <=> XX . + XXX . + XXXX . + XXXXX . + X <> <> = <> X X X X <> X X XX X <=X> XXXXXX . + <> [] [] XX XX XXX XX XXXXXXX . + <> [] [] [] XXX XXX XXXX XXX <> <> XXXXXXXX + []12345678[]123456[]123456789[]1234567890 123456 123456 12345 1234 12345 1234 123XXXX XXXX1234XXXXX XXXX1234[]123 1234567[]XXXXXXXXX12345678 +===========================..========..======..=========..=========> <=============> <==============================================================> <=======..==============..============================== +...................................................................] [.............] [..............................................................] [......................................................."; public World(Texture2D texture) { + string[] worldDesc = worldString.Split('\n'); width = worldDesc.AsQueryable().Max(a => a.Length); height = worldDesc.Length; Debug.WriteLine("world size: {0}x{1}", width, height);