Пример #1
0
    void serializeCellData(SerializableCell copyTo, WorldCell copyFrom)
    {
        // save cell indexes
        copyTo.x = copyFrom.x;
        copyTo.y = copyFrom.y;
        copyTo.z = copyFrom.z;

        // save sprite ids
        Dictionary<string, int> sprite_ids = copyFrom.getRenderData ().sprite_ids;
        foreach (KeyValuePair<string, int> sprite in sprite_ids) {
            SerializableSpriteId spr = new SerializableSpriteId();
            spr.id = sprite.Key;
            spr.y = sprite.Value;
            copyTo.sprite_ids.Add(spr);
        }
    }
Пример #2
0
 public void restoreCellData(SerializableCell restoreFrom)
 {
     renderData.restoreSpriteIds (restoreFrom.sprite_ids);
 }