(commented) support for Call server-to-client sounds

This commit is contained in:
Anuken
2021-07-16 15:39:03 -04:00
parent 5c6b659ce3
commit 0980495a28
4 changed files with 63 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
package mindustry.io;
import arc.audio.*;
import arc.graphics.*;
import arc.math.geom.*;
import arc.struct.*;
@@ -501,6 +502,15 @@ public class TypeIO{
return id == -1 ? null : content.item(id);
}
//note that only the standard sound constants in Sounds are supported; modded sounds are not.
public static void writeSound(Writes write, Sound sound){
write.s(Sounds.getSoundId(sound));
}
public static Sound readSound(Reads read){
return Sounds.getSound(read.s());
}
public static void writeWeather(Writes write, Weather item){
write.s(item == null ? -1 : item.id);
}