Esempio n. 1
0
        private void WriteAtomDeltasSection(PacketStream stream)
        {
            stream.WriteByte((byte)SectionID.AtomDeltas);
            stream.WriteUInt16((UInt16)DeltaState.AtomDeltas.Count);

            foreach (KeyValuePair <UInt32, DreamDeltaState.AtomDelta> atomDeltaPair in DeltaState.AtomDeltas)
            {
                UInt32 atomID = atomDeltaPair.Key;
                DreamDeltaState.AtomDelta atomDelta = atomDeltaPair.Value;

                stream.WriteUInt32(atomID);

                if (atomDelta.ScreenLocation.HasValue)
                {
                    stream.WriteByte((byte)AtomDeltaValueID.ScreenLocation);
                    stream.WriteScreenLocation(atomDelta.ScreenLocation.Value);
                }

                if (atomDelta.NewIconAppearanceID.HasValue)
                {
                    stream.WriteByte((byte)AtomDeltaValueID.IconAppearance);
                    stream.WriteUInt32((UInt32)atomDelta.NewIconAppearanceID.Value);
                }

                stream.WriteByte((byte)AtomDeltaValueID.End);
            }
        }
Esempio n. 2
0
 public void WriteToStream(PacketStream stream)
 {
     stream.WriteUInt32(AtomID);
     stream.WriteByte((byte)IconX);
     stream.WriteByte((byte)IconY);
     stream.WriteScreenLocation(ScreenLocation);
     stream.WriteBool(ModifierShift);
     stream.WriteBool(ModifierCtrl);
     stream.WriteBool(ModifierAlt);
 }
Esempio n. 3
0
        private void WriteAtomsSection(PacketStream stream)
        {
            stream.WriteUInt32((UInt32)FullState.Atoms.Count);

            foreach (KeyValuePair <UInt32, DreamFullState.Atom> atom in FullState.Atoms)
            {
                stream.WriteUInt32(atom.Value.AtomID);
                stream.WriteByte((byte)atom.Value.Type);
                stream.WriteUInt32(atom.Value.LocationID);
                stream.WriteUInt32((UInt32)atom.Value.IconAppearanceID);
                if (atom.Value.Type == AtomType.Movable)
                {
                    stream.WriteScreenLocation(atom.Value.ScreenLocation);
                }
            }
        }
Esempio n. 4
0
        private void WriteAtomCreationsSection(PacketStream stream)
        {
            stream.WriteByte((byte)SectionID.AtomCreations);
            stream.WriteUInt16((UInt16)DeltaState.AtomCreations.Count);

            foreach (KeyValuePair <UInt32, DreamDeltaState.AtomCreation> atomCreationPair in DeltaState.AtomCreations)
            {
                DreamDeltaState.AtomCreation atomCreation = atomCreationPair.Value;

                stream.WriteUInt32(atomCreationPair.Key);
                stream.WriteByte((byte)atomCreation.Type);
                stream.WriteUInt32((UInt32)atomCreation.IconAppearanceID);
                stream.WriteUInt32(atomCreation.LocationID);
                if (atomCreation.Type == AtomType.Movable)
                {
                    stream.WriteScreenLocation(atomCreation.ScreenLocation);
                }
            }
        }