예제 #1
0
 private void RefreshAreaEntity(object sender, ObjectSelectionEventArgs e)
 {
     if (!Object.ReferenceEquals(OnAreaLoaded, null))
     {
         OnAreaLoaded(sender, e);
     }
 }
예제 #2
0
        private void HandleAreaLoadEvent(object sender, ObjectSelectionEventArgs e)
        {
            Area selectedArea;
            using (AreaRepository repo = new AreaRepository())
            {
                selectedArea = repo.GetByID(e.ResourceID);
            }

            AreaEntityInstance.ChangeArea(selectedArea);
        }
예제 #3
0
        private void LoadObjectData(object sender, JavascriptMethodEventArgs e)
        {
            GameObjectFactory factory = new GameObjectFactory();
            int resourceID = (int)e.Arguments[0];
            GameObjectBase gameObject = factory.GetFromDatabaseByID(resourceID, ViewModel.GameObjectType);
            ObjectSelectionEventArgs eventArgs = new ObjectSelectionEventArgs(resourceID);

            if (ViewModel.GameObjectType == GameObjectTypeEnum.Area)
            {
                ViewModel.ActiveArea = gameObject as Area;
                RefreshAreaEntity(this, eventArgs);
            }
            else if (ViewModel.GameObjectType == GameObjectTypeEnum.Conversation)
            {
                ViewModel.ActiveConversation = gameObject as Conversation;
            }
            else if (ViewModel.GameObjectType == GameObjectTypeEnum.Creature)
            {
                ViewModel.ActiveCreature = gameObject as Creature;
            }
            else if (ViewModel.GameObjectType == GameObjectTypeEnum.Item)
            {
                ViewModel.ActiveItem = gameObject as Item;
            }
            else if (ViewModel.GameObjectType == GameObjectTypeEnum.Placeable)
            {
                ViewModel.ActivePlaceable = gameObject as Placeable;
            }
            else if (ViewModel.GameObjectType == GameObjectTypeEnum.Script)
            {
                ViewModel.ActiveScript = gameObject as Script;
            }
            else if (ViewModel.GameObjectType == GameObjectTypeEnum.Tileset)
            {
                ViewModel.ActiveTileset = gameObject as Tileset;
                RaiseTilesetLoadEvent(gameObject.GraphicResourceID);
            }

            AsyncJavascriptCallback("LoadObjectData_Callback");
        }