Ejemplo n.º 1
0
 public override void Write(BgoProtocolWriter w)
 {
     base.Write(w);
     w.Write(Name);
 }
Ejemplo n.º 2
0
        public void Write(BgoProtocolWriter w)
        {
            w.Write(sex);
            w.Write(race);
            w.Write((ushort)items.Count);
            foreach (KeyValuePair <string, List <string> > pair in items)
            {
                w.Write(pair.Key);
                int pairCount = pair.Value.Count;
                w.Write((ushort)pairCount);
                for (int i = 0; i < pairCount; i++)
                {
                    w.Write(pair.Value[i]);
                }
            }

            w.Write((ushort)materials.Count);
            foreach (KeyValuePair <string, Dictionary <string, List <string> > > pair in materials)
            {
                w.Write(pair.Key);
                w.Write((ushort)pair.Value.Count);

                foreach (KeyValuePair <string, List <string> > pair2 in pair.Value)
                {
                    w.Write(pair2.Key);
                    int pair2Count = pair2.Value.Count;
                    w.Write((ushort)pair2Count);
                    for (int i = 0; i < pair2Count; i++)
                    {
                        w.Write(pair2.Value[i]);
                    }
                }
            }

            w.Write((ushort)textures.Count);
            foreach (KeyValuePair <string, List <string> > pair3 in textures)
            {
                w.Write(pair3.Key);
                int pairCount = pair3.Value.Count;
                w.Write((ushort)pairCount);
                for (int i = 0; i < pairCount; i++)
                {
                    w.Write(pair3.Value[i]);
                }
            }
        }
Ejemplo n.º 3
0
        public override void Write(BgoProtocolWriter w)
        {
            base.Write(w);
            w.Write(Width);
            w.Write(Height);
            w.Write(Length);
            w.Write(RegulationCardGUID);
            w.Write(AmbientColor);
            w.Write(FogColor);
            w.Write(FogDensity);
            w.Write(DustColor);
            w.Write(DustDensity);
            NebulaDesc.Write(w);
            StarsDesc.Write(w);
            StarsMultDesc.Write(w);
            StarsVarianceDesc.Write(w);
            int num = MovingNebulaDescs.Length;

            w.Write((ushort)num);
            for (int i = 0; i < num; i++)
            {
                MovingNebulaDescs[i].Write(w);
            }
            int num2 = LightDescs.Length;

            w.Write((ushort)num2);
            for (int j = 0; j < num2; j++)
            {
                LightDescs[j].Write(w);
            }
            int num3 = SunDescs.Length;

            w.Write((ushort)num3);
            for (int k = 0; k < num3; k++)
            {
                SunDescs[k].Write(w);
            }
            GlobalFogDesc.Write(w);
            CameraFxDesc.Write(w);
            w.Write(RequiredAssets);
        }
Ejemplo n.º 4
0
        private void WriteProperty(BgoProtocolWriter w, IDictionary <UserSetting, object> settings, UserSetting property)
        {
            object obj = settings[property];

            w.Write((byte)property);
            UserSettingValueType valueType = GetValueType(property);

            w.Write((byte)valueType);
            switch (valueType)
            {
            case UserSettingValueType.Byte:
                w.Write((byte)obj);
                break;

            case UserSettingValueType.Float:
                w.Write((float)obj);
                break;

            case UserSettingValueType.Boolean:
                w.Write((bool)obj);
                break;

            case UserSettingValueType.Integer:
                w.Write((int)obj);
                break;

            case UserSettingValueType.Float2:
            {
                float2 @float = (float2)obj;
                w.Write(@float.x);
                w.Write(@float.y);
                break;
            }

            case UserSettingValueType.HelpScreenType:
            {
                List <HelpScreenType> list = (List <HelpScreenType>)obj;
                w.Write((ushort)list.Count);
                foreach (HelpScreenType item in list)
                {
                    w.Write((ushort)item);
                }
                break;
            }

            default:
                w.Write((byte)0);
                break;
            }
        }