Пример #1
0
        private IEnumerable <KeyValuePair <SceneItem, MeshItem> > GetDrawableItems(MapScene scene)
        {
            var containers = GetSceneContainers(scene);
            var kvList     = this.drawableItemsCache;

            foreach (var container in containers)
            {
                kvList.Clear();
                foreach (var item in container.Slots)
                {
                    var mesh = GetMesh(item);
                    if (mesh != null)
                    {
                        kvList.Add(new KeyValuePair <SceneItem, MeshItem>(item, mesh));
                    }
                }
                kvList.Sort((kv1, kv2) => kv1.Value.CompareTo(kv2.Value));
                foreach (var kv in kvList)
                {
                    yield return(kv);
                }
            }

            kvList.Clear();
        }
Пример #2
0
 protected override void LoadContent()
 {
     base.LoadContent();
     this.font  = new XnaFont(this.GraphicsDevice, "돋움", 24);
     this.scene = new MapScene(this.GraphicsDevice);
     this.scene.LoadMap(this.mapImg);
 }
Пример #3
0
        private IEnumerable <KeyValuePair <SceneItem, MeshItem> > GetDrawableItems(MapScene scene)
        {
            var containers = GetSceneContainers(scene).ToList();

            foreach (var container in containers)
            {
                foreach (var kv in container.Slots.Select(item => new KeyValuePair <SceneItem, MeshItem>(item, GetMesh(item)))
                         .Where(kv => kv.Value != null)
                         .OrderBy(kv => kv.Value))
                {
                    yield return(kv);
                }
            }
        }