Пример #1
0
 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());
         }
     }
 }
Пример #2
0
 public void Replace(BaseLevel level)
 {
     this.Name   = level.Name;
     this.Width  = level.Width;
     this.Height = level.Height;
 }
Пример #3
0
 public static string ReadLevelResourceAsString(BaseLevel level, string resource)
 {
     return(Encoding.Default.GetString(ReadLevelResource(level, resource)));
 }