Esempio n. 1
0
        public Chest(OgmoObject obj, Level level)
            : base(obj, level)
        {
            OgmoIntegerValue coins = obj.GetValue <OgmoIntegerValue>("coins");

            if (coins != null)
            {
                this.Coins = coins.Value;
            }
            this.Collision += new EventHandler <CollisionEventArgs>(Chest_Collision);
        }
 internal static OgmoValue Read(ContentReader reader)
 {
     OgmoValue value = null;
     string valueType = reader.ReadString();
     switch (valueType)
     {
         case "b":
             value = new OgmoBooleanValue(reader);
             break;
         case "i":
             value = new OgmoIntegerValue(reader);
             break;
         case "n":
             value = new OgmoNumberValue(reader);
             break;
         case "s":
             value = new OgmoStringValue(reader);
             break;
     }
     return value;
 }