Beispiel #1
0
 protected ObjectUpdate(ObjectID objectId, ObjectTypeID typeId, ObjectUpdateFlags updateFlags, MovementUpdate movementUpdate, ValuesUpdate valuesUpdate, ObjectUpdateType?type)
 {
     ObjectId       = objectId;
     TypeId         = typeId;
     UpdateFlags    = updateFlags;
     UpdateType     = type;
     MovementUpdate = movementUpdate;
     ValuesUpdate   = valuesUpdate;
 }
Beispiel #2
0
        protected GameObject(ObjectID id, ObjectTypeID typeId, ushort fieldsCount)
        {
            if (fieldsCount < (ushort)ObjectFields.END)
            {
                throw new ArgumentOutOfRangeException(nameof(fieldsCount), "field count must be at least the minimum for ObjectFields");
            }

            // must go first. other properties may actually be backed by this array
            fields     = new uint[fieldsCount];
            updateMask = new UpdateMask(fieldsCount);

            ID     = id;
            TypeID = typeId;
        }
Beispiel #3
0
        protected Unit(ObjectID id, ObjectTypeID typeId, ushort fieldsCount) : base(id, typeId, fieldsCount)
        {
            movementFlags        = MovementFlags.None;
            movementFlagsUpdated = false;
            MovementSpeed        = new MovementSpeed();

            // initialize default values
            CastSpeed = 1.0f;
            Energy    = 100;
            EnergyMax = 100;
            RageMax   = 1000;
            AttackTimeMainhandMilliseconds = 2000;
            AttackTimeOffhandMilliseconds  = 2000;
            AttackTimeRangedMilliseconds   = 2000;
        }
Beispiel #4
0
 /// <summary>
 /// Creates a new CreationUpdate instance.
 /// </summary>
 /// <param name="movementUpdate">Cannot be null</param>
 /// <param name="valuesUpdate">Cannot be null</param>
 public CreationUpdate(ObjectID id, ObjectTypeID typeId, ObjectUpdateFlags updateFlags, MovementUpdate movementUpdate, ValuesUpdate valuesUpdate) : base(
         id,
         typeId,
         updateFlags,
         movementUpdate ?? throw new ArgumentNullException(nameof(movementUpdate)),
         valuesUpdate ?? throw new ArgumentNullException(nameof(valuesUpdate)),
         id.ObjectType == ObjectID.Type.Corpse ||
         id.ObjectType == ObjectID.Type.DynamicObject ||
         id.ObjectType == ObjectID.Type.GameObject ||
         id.ObjectType == ObjectID.Type.Player ||
         id.ObjectType == ObjectID.Type.Unit ?
         ObjectUpdateType.CreateObject2 :
         ObjectUpdateType.CreateObject)
 {
 }
Beispiel #5
0
        public int CompareTo(BLeaderStartingUnit other)
        {
            if (DoppleOnStart != other.DoppleOnStart)
            {
                DoppleOnStart.CompareTo(other.DoppleOnStart);
            }

            if (Offset != other.Offset)
            {
                Offset.CompareTo(other.Offset);
            }

            if (ObjectTypeID != other.ObjectTypeID)
            {
                ObjectTypeID.CompareTo(other.ObjectTypeID);
            }

            return(BuildOtherID.CompareTo(other.BuildOtherID));
        }
        /// <summary>
        /// A <code>DiagramObject</code> factory method.
        /// </summary>
        /// <param name="type">Object type to create</param>
        /// <returns>Initialised <code>DiagramObject</code> instance. Must be edited after before adding to diagram.</returns>
        public DiagramObject CreateNewObjectInstance(ObjectTypeID type)
        {
            switch (type)
            {
            case ObjectTypeID.Atom:
                return(new Atom());

            case ObjectTypeID.Bond:
                return(new Bond());

            case ObjectTypeID.Line:
                return(new Line());

            case ObjectTypeID.Text:
                return(new Text());

            default:
                throw new ArgumentException("Invalid DiagramObject type.");
            }
        }
Beispiel #7
0
 public GameObject(ObjectID id, ObjectTypeID typeId) : this(id, typeId, (ushort)ObjectFields.END)
 {
 }
Beispiel #8
0
 public Unit(ObjectID id, ObjectTypeID typeId) : this(id, typeId, (ushort)UnitFields.END)
 {
 }
Beispiel #9
0
 public bool Equals(ModuleObject other)
 {
     return(ObjectGuidID.Equals(other.ObjectGuidID) && ObjectLongID.Equals(other.ObjectLongID) && ObjectTypeID.Equals(other.ObjectTypeID) && ServiceCode.Equals(other.ServiceCode));
 }
Beispiel #10
0
 public virtual String ToString()
 {
     return("oType:" + FQN + " type:" + ObjectTypeID.ToString() + " Id:" + ObjectLongID.ToString() + " IdVersion:" + ObjectIdVersion.ToString() + " idCommunity:" + CommunityID.ToString() + " module:" + ServiceCode);
 }
Beispiel #11
0
 /// <summary>
 /// Creates a new ObjectUpdate. If this is not a CreationUpdate, then only
 /// one of movementUpdate or valuesUpdate may be non-null.
 /// </summary>
 public ObjectUpdate(ObjectID objectId, ObjectTypeID typeId, ObjectUpdateFlags updateFlags, MovementUpdate movementUpdate, ValuesUpdate valuesUpdate)
     : this(objectId, typeId, updateFlags, movementUpdate, valuesUpdate, null)
 {
 }