Beispiel #1
0
        /// <summary>
        /// Constructor by values
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="Count"></param>
        /// <param name="OverlayFileRID"></param>
        /// <param name="NameRID"></param>
        /// <param name="Flags"></param>
        /// <param name="LightFlags"></param>
        /// <param name="LightIntensity"></param>
        /// <param name="LightColor"></param>
        /// <param name="FirstAnimationType"></param>
        /// <param name="ColorTranslation"></param>
        /// <param name="Effect"></param>
        /// <param name="Animation"></param>
        /// <param name="SubOverlays"></param>
        /// <param name="HasLight"></param>
        public ObjectBase(
            uint ID,
            uint Count,
            uint OverlayFileRID,
            uint NameRID,
            uint Flags,
            ushort LightFlags,
            byte LightIntensity,
            ushort LightColor,
            AnimationType FirstAnimationType,
            byte ColorTranslation,
            byte Effect,
            Animation Animation,
            IEnumerable <SubOverlay> SubOverlays,
            bool HasLight = true)
            : base(ID, Count)
        {
            // with light ?
            hasLight = HasLight;

            // basic
            overlayFileRID = OverlayFileRID;
            nameRID        = NameRID;
            flags.Value    = Flags;

            // light
            lightFlags     = LightFlags;
            lightIntensity = LightIntensity;
            lightColor     = LightColor;

            // first animation: colortranslation or effect
            firstAnimationType = FirstAnimationType;
            colorTranslation   = ColorTranslation;
            effect             = Effect;

            // special handling for secondtrans
            if (flags.Drawing == ObjectFlags.DrawingType.SecondTrans)
            {
                colorTranslation = ColorTransformation.FILTERWHITE90;

                foreach (SubOverlay subOv in SubOverlays)
                {
                    subOv.ColorTranslation = ColorTransformation.FILTERWHITE90;
                }
            }

            // animation
            animation = Animation;
            animation.PropertyChanged += OnAnimationPropertyChanged;


            // suboverlays
            subOverlays.AddRange(SubOverlays);

            // attach listeners last (no need to refresh in contructor)
            subOverlays.ListChanged += OnSubOverlaysListChanged;
            flags.PropertyChanged   += OnFlagsPropertyChanged;
        }
 public DiplomacyInfo(IEnumerable <GuildEntry> Guilds,
                      IEnumerable <ObjectID> YouDeclaredAllyList, IEnumerable <ObjectID> YouDeclaredEnemyList,
                      IEnumerable <ObjectID> DeclaredYouAllyList, IEnumerable <ObjectID> DeclaredYouEnemyList)
 {
     guilds.AddRange(Guilds);
     youDeclaredAllyList.AddRange(YouDeclaredAllyList);
     youDeclaredEnemyList.AddRange(YouDeclaredEnemyList);
     declaredYouAllyList.AddRange(DeclaredYouAllyList);
     declaredYouEnemyList.AddRange(DeclaredYouEnemyList);
 }
Beispiel #3
0
 public static async void CollectionsToList()
 {
     await Task.Run(() =>
     {
         BaseList.Clear();
         BaseList.AddRange(KingdomList);
         BaseList.AddRange(MonarchyList);
         BaseList.AddRange(RepublicList);
     });
 }
        public void Commit()
        {
            BaseList.AddRange(_toAdd);
            BaseList.RemoveAll(x => _toDelete.Any(y => y.TransactionalListEquals(x)));

            foreach (var item in _toUpdate)
            {
                var ind = BaseList.FindIndex(x => x.TransactionalListEquals(item));
                BaseList[ind] = item;
            }

            _toAdd.Clear();
            _toDelete.Clear();
            _toUpdate.Clear();
        }
Beispiel #5
0
        public void Commit()
        {
            if (_updateAction == null)
            {
                throw new InvalidOperationException("Update action cannot be null.");
            }

            BaseList.AddRange(_toAdd);
            BaseList.RemoveAll(x => _toDelete.Any(y => y.TransactionalListEquals(x)));

            foreach (var item in _toUpdate)
            {
                var baseItem = BaseList.Single(x => x.TransactionalListEquals(item));
                _updateAction(baseItem, item);
            }

            _toAdd.Clear();
            _toDelete.Clear();
            _toUpdate.Clear();
        }
Beispiel #6
0
 /// <summary>
 /// Constructor by values
 /// </summary>
 public AdminInfoObject(uint ID, string ClassName, IEnumerable <AdminInfoProperty> Properties)
 {
     id        = ID;
     className = ClassName;
     properties.AddRange(Properties);
 }
 public GuildHallsInfo(IEnumerable <GuildHall> GuildHalls)
 {
     guildHalls.AddRange(GuildHalls);
 }
Beispiel #8
0
 public WelcomeInfo(IEnumerable <CharSelectItem> Characters, IEnumerable <CharSelectAd> Ads, string MOTD)
 {
     characters.AddRange(Characters);
     ads.AddRange(Ads);
     motd = MOTD;
 }