Exemplo n.º 1
0
        public MapControl3()
        {
            m_drawingCache = new DrawingCache();
            m_symbolDrawingCache = new SymbolDrawingCache(m_drawingCache);
            m_symbolBitmapCache = new SymbolBitmapCache(m_symbolDrawingCache, m_tileSize);

            m_map = new Map(512, 512);
            for (int y = 0; y < m_map.Height; ++y)
            {
                for (int x = 0; x < m_map.Width; ++x)
                {
                    m_map.MapArray[y, x] = (x + (y % 2)) % 2 == 0 ? (byte)50 : (byte)255;
                }
            }
        }
Exemplo n.º 2
0
        public void Load(Uri symbolInfoUri)
        {
            m_drawingMap = new Dictionary<SymbolID, Dictionary<GameColor, Drawing>>();

            var resInfo = Application.GetRemoteStream(symbolInfoUri);

            var settings = new System.Xaml.XamlXmlReaderSettings()
            {
                LocalAssembly = System.Reflection.Assembly.GetCallingAssembly(),
            };

            using (var reader = new System.Xaml.XamlXmlReader(resInfo.Stream, settings))
                m_symbolSet = (Symbols.SymbolSet)System.Xaml.XamlServices.Load(reader);

            if (m_symbolSet.Drawings != null)
                m_drawingCache = new DrawingCache(new Uri(m_symbolSet.Drawings, UriKind.Relative));
        }
Exemplo n.º 3
0
        public void Load(Uri symbolInfoUri)
        {
            m_drawingMap = new Dictionary <SymbolID, Dictionary <GameColor, Drawing> >();

            var resInfo = Application.GetRemoteStream(symbolInfoUri);

            var settings = new System.Xaml.XamlXmlReaderSettings()
            {
                LocalAssembly = System.Reflection.Assembly.GetCallingAssembly(),
            };

            using (var reader = new System.Xaml.XamlXmlReader(resInfo.Stream, settings))
                m_symbolSet = (Symbols.SymbolSet)System.Xaml.XamlServices.Load(reader);

            if (m_symbolSet.Drawings != null)
            {
                m_drawingCache = new DrawingCache(new Uri(m_symbolSet.Drawings, UriKind.Relative));
            }
        }
Exemplo n.º 4
0
        public MapControl4()
        {
            m_drawingCache = new DrawingCache();
            m_symbolDrawingCache = new SymbolDrawingCache(m_drawingCache);
            m_symbolBitmapCache = new SymbolBitmapCache(m_symbolDrawingCache, m_tileSize);

            m_map = new Map(512, 512);
            for (int y = 0; y < m_map.Height; ++y)
            {
                for (int x = 0; x < m_map.Width; ++x)
                {
                    m_map.MapArray[y, x] = (x + (y % 2)) % 2 == 0 ? (byte)50 : (byte)255;
                }
            }

            m_bmpArray = new BitmapSource[10];
            for (int i = 0; i < 10; ++i)
                m_bmpArray[i] = m_symbolBitmapCache.GetBitmap((SymbolID)i, Colors.Black, false);

            m_mcd2d = new TileControlD2D();
            m_mcd2d.SetSymbolBitmaps(m_bmpArray, m_tileSize);
            AddChild(m_mcd2d);
        }
Exemplo n.º 5
0
 public SymbolDrawingCache(DrawingCache drawingCache)
 {
     m_drawingCache = drawingCache;
     ParseSymbols();
 }
Exemplo n.º 6
0
 public SymbolDrawingCache(DrawingCache drawingCache)
 {
     m_drawingCache = drawingCache;
     ParseSymbols();
 }