コード例 #1
0
        /// <summary>
        /// Constructs a ShadowSpriteGroup instance from the given sprite palette.
        /// </summary>
        /// <param name="spritePalette">The sprite palette that contains the sprites for drawing the shadows.</param>
        public ShadowSpriteGroup(IMetadataView metadataView)
        {
            if (metadataView == null)
            {
                throw new ArgumentNullException("metadataView");
            }

            this.metadataView = metadataView;
        }
コード例 #2
0
        /// <summary>
        /// Constructs a HPIconSpriteGroup instance.
        /// </summary>
        /// <param name="metadataView">Reference to the metadata view.</param>
        /// <param name="condition">The condition for which this sprite group is created.</param>
        public HPIconSpriteGroup(IMetadataView metadataView, MapObjectConditionEnum condition)
        {
            if (metadataView == null)
            {
                throw new ArgumentNullException("metadataView");
            }

            this.metadataView = metadataView;
            this.condition    = condition;
        }
コード例 #3
0
        /// <summary>
        /// Constructs a MapObjectSpriteGroup instance.
        /// </summary>
        /// <param name="metadataView">Reference to the metadata view.</param>
        /// <param name="owner">The owner of the map objects in this group.</param>
        public MapObjectSpriteGroup(IMetadataView metadataView, PlayerEnum owner)
            : base()
        {
            if (metadataView == null)
            {
                throw new ArgumentNullException("metadataView");
            }

            this.metadataView = metadataView;
            this.owner        = owner;
        }
        /// <summary>
        /// Initializes a new instance of the MetadataViewPresentationModel class.
        /// </summary>
        /// <param name="view">The instance of IMetadataView interface.</param>
        /// <param name="configurationService">The instance of IConfigurationService interface.</param>
        /// <param name="eventAggregator">The instance of IEventAggregator interface.</param>
        public MetadataViewPresentationModel(IMetadataView view, IConfigurationService configurationService, IEventAggregator eventAggregator)
        {
            this.eventAggregator = eventAggregator;
            this.eventAggregator.GetEvent <ShowMetadataEvent>().Subscribe(this.ShowMetadata, true);
            this.eventAggregator.GetEvent <HideMetadataEvent>().Subscribe(this.HideMetadata, true);

            this.metadataFields = configurationService.GetMetadataFields();

            this.View       = view;
            this.View.Model = this;
            this.ShowMetadataInformation = false;
        }
コード例 #5
0
        /// <see cref="RCMapDisplayExtension.ConnectEx_i"/>
        protected override void ConnectEx_i()
        {
            IViewService viewService = ComponentManager.GetInterface <IViewService>();

            this.mapObjectView = viewService.CreateView <IMapObjectView>();

            IMetadataView metadataView = viewService.CreateView <IMetadataView>();

            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player0));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player1));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player2));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player3));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player4));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player5));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player6));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Player7));
            this.mapObjectSprites.Add(new MapObjectSpriteGroup(metadataView, PlayerEnum.Neutral));

            this.shadowSprites = new ShadowSpriteGroup(metadataView);
        }