Inheritance: IHasRect
Exemplo n.º 1
0
        public virtual void AddAsset(Asset asset)
        {
            if(!_assetList.ContainsKey(asset.AssetID))
            {
                _assetList.Add(asset.AssetID, asset);

                if(asset.AssetID.ID >= _currentIDList[asset.AssetID.Vector])
                {
                    _currentIDList[asset.AssetID.Vector] = asset.AssetID.ID + 1;
                }
            }
        }
Exemplo n.º 2
0
        private void tvwWorld_DoubleClick(object sender, EventArgs e)
        {
            Area area = Azmyth.Assets.Assets.GetArea((VectorID)tvwWorld.SelectedNode.Tag);

            if(area != null)
            {
                tabMain.SelectedIndex = tabMain.TabPages.IndexOfKey(area.AssetID.ToString());

                _selected = area;
            }
        }
Exemplo n.º 3
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            World world = null;
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter = "World File (*.wld)|*.wld";

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {

                world = LoadWorld(dialog.FileName);

                VectorID worldID = null;
                MapViewer areaView = null;

                Assets.Assets.Store.AddAsset(world);

                worldID = world.AssetID;

                areaView = new MapViewer(worldID);
                areaView.Name = "av" + worldID.ID;
                areaView.AreaNode = _root.Nodes.Add(world.Name);
                areaView.AreaNode.Tag = worldID;

                areaView.Dock = DockStyle.Fill;

                tabMain.TabPages.Add(worldID.ToString(), world.Name);
                tabMain.SelectedIndex = tabMain.TabPages.IndexOfKey(worldID.ToString());
                tabMain.SelectedTab.Controls.Add(areaView);

                areaView.AreaPage = tabMain.SelectedTab;
                areaView.CellHover +=areaView_CellHover;
                _selected = world;
            }
        }
Exemplo n.º 4
0
        private void btnNewArea_Click(object sender, EventArgs e)
        {
            VectorID worldID = null;
            MapViewer areaView = null;

            worldID = Azmyth.Assets.Assets.CreateWorld();

            areaView = new MapViewer(worldID);
            areaView.Name = "av" + worldID.ID;
            areaView.AreaNode = _root.Nodes.Add(Azmyth.Assets.Assets.Store[worldID].Name);
            areaView.AreaNode.Tag = worldID;

            areaView.Dock = DockStyle.Fill;

            tabMain.TabPages.Add(worldID.ToString(), Azmyth.Assets.Assets.Store[worldID].Name);
            tabMain.SelectedIndex = tabMain.TabPages.IndexOfKey(worldID.ToString());
            tabMain.SelectedTab.Controls.Add(areaView);

            areaView.AreaPage = tabMain.SelectedTab;
            areaView.CellHover +=areaView_CellHover;
            _selected = Azmyth.Assets.Assets.Store[worldID];
        }
Exemplo n.º 5
0
 public virtual void RemoveAsset(Asset asset)
 {
     RemoveAsset(asset.AssetID);
 }
Exemplo n.º 6
0
 //public virtual void ApplyAffect(Affect affect)
 //{
 //    if(!_affects.ContainsKey(affect.AffectID))
 //    {
 //        _affects.Add(affect.AffectID, affect);
 //        foreach (VectorID statID in _stats.Keys)
 //        {
 //            if (affect[statID] != null)
 //            {
 //                _stats[statID].Modifier += affect[statID].Modifier;
 //            }
 //        }
 //    }
 //}
 //public virtual void RemoveAffect(Affect affect)
 //{
 //    if (_affects.ContainsKey(affect.AffectID))
 //    {
 //        _affects.Remove(affect.AffectID);
 //        foreach (VectorID statID in _stats.Keys)
 //        {
 //            if (affect[statID] != null)
 //            {
 //                _stats[statID].Modifier -= affect[statID].Modifier;
 //            }
 //        }
 //    }
 //}
 //public virtual void RemoveAffects()
 //{
 //    _affects.Clear();
 //}
 //public virtual void RemoveAffects(long vector)
 //{
 //    if (_affects.Vectors.Contains(vector))
 //    {
 //        foreach (VectorID statID in _affects[vector].Keys)
 //        {
 //            // RemoveAffect(_affects[statID]);
 //        }
 //    }
 //}
 //public virtual void UpdateAffects()
 //{
 //    foreach (Affect affect in _affects.Values)
 //    {
 //        if (affect != null)
 //        {
 //            affect.Duration--;
 //            if (affect.Duration == 0)
 //            {
 //                //RemoveAffect(affect);
 //            }
 //        }
 //    }
 //}
 public virtual void AddAsset(Asset asset)
 {
     _assets.Add(asset.AssetID, asset);
 }