예제 #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);
        }
예제 #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]);
     }
 }
예제 #3
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
 }
예제 #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");
 }
예제 #5
0
파일: Spiny.cs 프로젝트: smldev/smlimitless
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     SpinyState = (SpinyState)customObjects.GetInt("spinyState");
 }
예제 #6
0
파일: Tile.cs 프로젝트: smldev/smlimitless
 /// <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);
예제 #7
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     SpawnBandStart = customObjects.GetFloat("spawnBandStart");
     SpawnBandEnd = customObjects.GetFloat("spawnBandEnd");
     ThrownSprite = TypeSerializer.DeserializeSprite(customObjects, "thrownSprite");
 }
예제 #8
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     Variety = (KoopaVariety)customObjects.GetInt("type");
 }
예제 #9
0
 public override void DeserializeCustomObjects(JsonHelper customObjects)
 {
     Palette = (GoombaPalette)customObjects.GetInt("palette");
 }