public static byte[] ReadLevelResource(BaseLevel level, string resource) { using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("neonrpg.Assets.Levels." + level.Name + "_Data." + resource)) { using (MemoryStream memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); return(memoryStream.ToArray()); } } }
public void Replace(BaseLevel level) { this.Name = level.Name; this.Width = level.Width; this.Height = level.Height; }
public static string ReadLevelResourceAsString(BaseLevel level, string resource) { return(Encoding.Default.GetString(ReadLevelResource(level, resource))); }