Esempio n. 1
0
 public bool TryGetValueAsDreamResource(out DreamResource value)
 {
     if (IsType(DreamValueType.DreamResource))
     {
         value = (DreamResource)Value;
         return(true);
     }
     else
     {
         value = null;
         return(false);
     }
 }
Esempio n. 2
0
            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;
                }
Esempio n. 3
0
 public DreamValue(DreamResource value)
 {
     Type  = DreamValueType.DreamResource;
     Value = value;
 }