Exemplo n.º 1
0
        public override void DeserializeCustomObjects(JsonHelper customObjects)
        {
            widthInGridCells = customObjects.GetInt("widthInGridCells");
            heightInGridCells = customObjects.GetInt("heightInGridCells");

            Size = new Vector2(widthInGridCells * GameServices.GameObjectSize.X, GameServices.GameObjectSize.Y);
        }
Exemplo n.º 2
0
 /// <summary>
 ///   Deserializes a sprite, given a <see cref="JsonHelper" /> and a key
 ///   for the sprite.
 /// </summary>
 /// <param name="helper">
 ///   The <see cref="JsonHelper" /> that contains the sprite to deserialize
 /// </param>
 /// <param name="key">The key in which the sprite is stored.</param>
 /// <returns>A deserialized (but uninitalized) sprite.</returns>
 public static Sprite DeserializeSprite(JsonHelper helper, string key = "")
 {
     if (string.IsNullOrEmpty(key))
     {
         return DeserializeSprite((JObject)helper.Value);
     }
     else
     {
         if (helper.Value[key].Type == JTokenType.Null) { return null; }
         return DeserializeSprite((JObject)helper.Value[key]);
     }
 }
Exemplo n.º 3
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
 }
Exemplo n.º 4
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     ContainedSprite = TypeSerializer.DeserializeSprite(customObjects, "containedSprite");
     ReleaseType = (ItemBlockItemReleaseType)customObjects.GetInt("releaseType");
     Quantity = customObjects.GetInt("quantity");
     TimeLimit = customObjects.GetFloat("timeLimit");
     IsEmpty = customObjects.GetBool("isEmpty");
 }
Exemplo n.º 5
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     SpinyState = (SpinyState)customObjects.GetInt("spinyState");
 }
Exemplo n.º 6
0
 /// <summary>
 ///   Loads key custom objects from the level file.
 /// </summary>
 /// <param name="customObjects">An object containing key custom objects.</param>
 public abstract void DeserializeCustomObjects(JsonHelper customObjects);
Exemplo n.º 7
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     SpawnBandStart = customObjects.GetFloat("spawnBandStart");
     SpawnBandEnd = customObjects.GetFloat("spawnBandEnd");
     ThrownSprite = TypeSerializer.DeserializeSprite(customObjects, "thrownSprite");
 }
Exemplo n.º 8
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     Variety = (KoopaVariety)customObjects.GetInt("type");
 }
Exemplo n.º 9
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     Palette = (GoombaPalette)customObjects.GetInt("palette");
 }