Beispiel #1
0
 private void SaveScript(object sender, GameObjectSaveEventArgs e)
 {
     using (ScriptRepository repo = new ScriptRepository())
     {
         repo.Upsert(e.ActiveScript);
     }
 }
Beispiel #2
0
        private void SaveTileset(object sender, GameObjectSaveEventArgs e)
        {
            e.ActiveTileset.TileList = (from tile
                                        in TilesetEditorEntityInstance.TileList
                                        select new Tile
                                        {
                                            TextureCellX = tile.SpriteSheetColumn,
                                            TextureCellY = tile.SpriteSheetRow,
                                            TilesetID = e.ActiveTileset.ResourceID,
                                            CollisionBoxes = (from box
                                                              in tile.CollisionBoxList
                                                              select new TileCollisionBox
                                                              {
                                                                  IsPassable = box.IsPassable,
                                                                  TileLocationIndex = box.TileIndex
                                                              }).ToList()
                                        }).ToList();

            using (TilesetRepository repo = new TilesetRepository())
            {
                repo.Upsert(e.ActiveTileset);
            }
        }
Beispiel #3
0
 private void SavePlaceable(object sender, GameObjectSaveEventArgs e)
 {
     using (PlaceableRepository repo = new PlaceableRepository())
     {
         repo.Upsert(e.ActivePlaceable);
     }
 }
Beispiel #4
0
 private void SaveItem(object sender, GameObjectSaveEventArgs e)
 {
     using (ItemRepository repo = new ItemRepository())
     {
         repo.Upsert(e.ActiveItem);
     }
 }
Beispiel #5
0
 private void SaveCreature(object sender, GameObjectSaveEventArgs e)
 {
     using (CreatureRepository repo = new CreatureRepository())
     {
         repo.Upsert(e.ActiveCreature);
     }
 }
Beispiel #6
0
 private void SaveConversation(object sender, GameObjectSaveEventArgs e)
 {
     using (ConversationRepository repo = new ConversationRepository())
     {
         repo.Upsert(e.ActiveConversation);
     }
 }
Beispiel #7
0
 private void SaveArea(object sender, GameObjectSaveEventArgs e)
 {
     using (AreaRepository repo = new AreaRepository())
     {
         repo.Upsert(e.ActiveArea);
     }
 }