public bool TryGetValueAsDreamResource(out DreamResource value) { if (IsType(DreamValueType.DreamResource)) { value = (DreamResource)Value; return(true); } else { value = null; return(false); } }
public DreamIconObject(DreamResource rsc, DreamValue state, DreamValue dir, DreamValue frame, DreamValue moving) { if (Path.GetExtension(rsc.ResourcePath) != ".dmi") { throw new Exception("Invalid icon file"); } Description = DMIParser.ParseDMI(new MemoryStream(rsc.ResourceData)); Icon = rsc.ResourcePath; // TODO confirm BYOND behavior of invalid args for icon, dir, and frame state.TryGetValueAsString(out State); if (dir.TryGetValueAsInteger(out var dirVal) && (AtomDirection)dirVal != AtomDirection.None) { Direction = (AtomDirection)dirVal; }
public DreamValue(DreamResource value) { Type = DreamValueType.DreamResource; Value = value; }