コード例 #1
0
ファイル: LogicCalendar.cs プロジェクト: NotHuza/Cerberus-v4
        /// <summary>
        ///     Gets the checksum of this instance.
        /// </summary>
        public void GetChecksum(ChecksumHelper checksum)
        {
            checksum.StartObject("LogicCalendar");
            checksum.StartArray("m_pActiveCalendarEvents");

            for (int i = 0; i < this._activeCalendarEvents.Count; i++)
            {
                checksum.StartObject("LogicCalendarEvent");
                checksum.EndObject();
            }

            checksum.EndArray();
            checksum.WriteValue("m_activeTimestamp", this._activeTimestamp);
            checksum.EndObject();
        }
コード例 #2
0
 public override void GetChecksum(ChecksumHelper checksum)
 {
     checksum.StartObject("LogicResourceProductionComponent");
     checksum.WriteValue("resourceTimer", this.m_resourceTimer.GetRemainingSeconds(this.m_parent.GetLevel().GetLogicTime()));
     checksum.WriteValue("m_availableLoot", this.m_availableLoot);
     checksum.WriteValue("m_maxResources", this.m_maxResources);
     checksum.WriteValue("m_productionPer100Hour", this.m_productionPer100Hour);
     checksum.EndObject();
 }
コード例 #3
0
        /// <summary>
        ///     Gets the checksum of this instance.
        /// </summary>
        public void GetChecksum(ChecksumHelper checksumHelper)
        {
            checksumHelper.StartObject("LogicDataSlot");

            if (this._data != null)
            {
                checksumHelper.WriteValue("globalID", this._data.GetGlobalID());
            }

            checksumHelper.WriteValue("m_count", this._count);
            checksumHelper.EndObject();
        }
コード例 #4
0
        /// <summary>
        ///     Gets the checksum of this instance.
        /// </summary>
        public override void GetChecksum(ChecksumHelper checksum, bool includeGameObjects)
        {
            checksum.StartObject("LogicTrap");

            base.GetChecksum(checksum, includeGameObjects);

            if (this._constructionTimer != null)
            {
                checksum.WriteValue("remainingMS", this._constructionTimer.GetRemainingMS(this._level.GetLogicTime()));
            }

            checksum.EndObject();
        }
コード例 #5
0
ファイル: LogicGameMode.cs プロジェクト: NotHuza/Cerberus-v4
        /// <summary>
        ///     Calculates the checksum of this instance.
        /// </summary>
        public ChecksumHelper CalculateChecksum(bool includeGameObjects)
        {
            ChecksumHelper checksum = new ChecksumHelper();

            checksum.StartObject("LogicGameMode");

            checksum.WriteValue("subTick", this._level.GetLogicTime());
            checksum.WriteValue("m_currentTimestamp", this._currentTimestamp);

            if (this._level.GetHomeOwnerAvatar() != null)
            {
                checksum.StartObject("homeOwner");
                this._level.GetHomeOwnerAvatar().GetChecksum(checksum);
                checksum.EndObject();
            }

            if (this._level.GetVisitorAvatar() != null)
            {
                checksum.StartObject("visitor");
                this._level.GetVisitorAvatar().GetChecksum(checksum);
                checksum.EndObject();
            }

            this._level.GetGameObjectManager().GetChecksum(checksum, includeGameObjects);

            if (this._calendar != null)
            {
                checksum.StartObject("calendar");
                this._calendar.GetChecksum(checksum);
                checksum.EndObject();
            }

            checksum.WriteValue("checksum", checksum);
            checksum.EndObject();

            return(checksum);
        }
コード例 #6
0
        /// <summary>
        ///     Gets the checksum of this instance.
        /// </summary>
        public virtual void GetChecksum(ChecksumHelper checksum, bool includeGameObjects)
        {
            if (includeGameObjects)
            {
                checksum.StartObject("LogicGameObject");

                checksum.WriteValue("type", this.GetGameObjectType());
                checksum.WriteValue("globalID", this._globalId);
                checksum.WriteValue("dataGlobalID", this._data.GetGlobalID());
                checksum.WriteValue("x", this.GetX());
                checksum.WriteValue("y", this.GetY());
                checksum.WriteValue("seed", this._seed);

                if (this.GetHitpointComponent() != null)
                {
                    LogicHitpointComponent hitpointComponent = this.GetHitpointComponent();

                    checksum.WriteValue("m_hp", hitpointComponent.InternalGetHp());
                    checksum.WriteValue("m_maxHP", hitpointComponent.InternalGetMaxHp());
                }

                checksum.EndObject();
            }
        }
コード例 #7
0
        public virtual void GetChecksum(ChecksumHelper checksum, bool includeGameObjects)
        {
            if (includeGameObjects)
            {
                checksum.StartObject("LogicGameObject");

                checksum.WriteValue("type", (int)this.GetGameObjectType());
                checksum.WriteValue("globalID", this.m_globalId);
                checksum.WriteValue("dataGlobalID", this.m_data.GetGlobalID());
                checksum.WriteValue("x", this.GetX());
                checksum.WriteValue("y", this.GetY());
                checksum.WriteValue("seed", this.m_seed);

                LogicHitpointComponent hitpointComponent = this.GetHitpointComponent();

                if (hitpointComponent != null)
                {
                    checksum.WriteValue("m_hp", hitpointComponent.GetHitpoints());
                    checksum.WriteValue("m_maxHP", hitpointComponent.GetMaxHitpoints());
                }

                LogicCombatComponent combatComponent = this.GetCombatComponent();

                if (combatComponent != null)
                {
                    LogicGameObject target = combatComponent.GetTarget(0);

                    if (target != null)
                    {
                        checksum.WriteValue("target", target.GetGlobalID());
                    }
                }

                checksum.EndObject();
            }
        }