Exemplo n.º 1
0
        public RestEvent(eType Ty, eVersion V, string M, string T, string O, string Ta)
        {
            Type    = Ty;
            Version = V;
            Message = M;
            Title   = T;
            Origin  = O;
            Target  = Ta;

            ID = Math.Abs(DateTime.Now.GetHashCode());
        }
Exemplo n.º 2
0
        public void Clear()
        {
            // static

            _version = eVersion.None;

            _classes = null;
            _values  = null;

            // public

            Version = eVersion.None;

            Width  = -1;
            Height = -1;

            Cells.Clear();
        }
Exemplo n.º 3
0
        private static void Initialize(eVersion version)
        {
#if DEBUG
            Contract.Assert(version > eVersion.None && version < eVersion.Total);
#endif
            if (_version == version)
            {
                return;
            }

            _version = version;

            _classes = new string[] {
                "Regions", "CartelRegions", "Terrain", "Planets", "Bases"
            };

            switch (version)
            {
            case eVersion.Sfc2Eaw:
            {
                throw new NotImplementedException();
            }

            case eVersion.Sfc2Op:
            {
                _values = new string[][] {
                    new string[] { "Neutral", "Federation", "Klingon", "Romulan", "Lyran", "Hydran", "Gorn", "ISC", "Mirak" },
                    new string[] { "Neutral", "OrionOrion", "OrionKorgath", "OrionPrime", "OrionTigerHeart", "OrionBeastRaiders", "OrionSyndicate", "OrionWyldeFire", "OrionCamboro" },
                    new string[] { "Space 1", "Space 2", "Space 3", "Space 4", "Space 5", "Space 6", "Asteroid 1", "Asteroid 2", "Asteroid 3", "Asteroid 4", "Asteroid 5", "Asteroid 6", "Nebula 1", "Nebula 2", "Nebula 3", "Nebula 4", "Nebula 5", "Nebula 6", "Blackhole1", "Blackhole2", "Blackhole3", "Blackhole4", "Blackhole5", "Blackhole6" },
                    new string[] { "(none)", "Homeworld 1", "Homeworld 2", "Homeworld 3", "Core World 1", "Core World 2", "Core World 3", "Colony 1", "Colony 2", "Colony 3", "Asteroid Base 1", "Asteroid Base 2", "Asteroid Base 3" },
                    new string[] { "(none)", "Starbase", "Battle Station", "Base Station", "Weapons Platform", "Listening Post" }
                };

                break;
            }

            case eVersion.Sfc3:
            {
                throw new NotImplementedException();
            }
            }
        }
Exemplo n.º 4
0
            internal Events(string eventSource, eVersion ver)
            {
                string[][] data = ParseCategory(eventSource, @"\[Events\]", typeof(eEventFormat), (int)eEventFormat.Prefix);

                events = new Event[data.Length];
                if ((ver & eVersion.v4ASS) != 0)
                {
                    for (int i = 0; i < data.Length; i++)
                    {
                        events[i] = new Event_ASS(data[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < data.Length; i++)
                    {
                        events[i] = new Event_SSA(data[i]);
                    }
                }
            }
Exemplo n.º 5
0
            internal Styles(string styleSource, eVersion ver)
            {
                string[][] data = SSA_ASS.ParseCategory(styleSource, @"\[V4[\+]? Styles\]", typeof(eStyleFormat), (int)eStyleFormat.Prefix);

                styles = new Style[data.Length];

                if ((ver & eVersion.v4ASS) != 0)
                {
                    for (int i = 0; i < data.Length; i++)
                    {
                        styles[i] = new Style_ASS(data[i]);
                    }
                }
                else
                {
                    for (int i = 0; i < data.Length; i++)
                    {
                        styles[i] = new Style_SSA(data[i]);
                    }
                }
            }
Exemplo n.º 6
0
            public tCell(eVersion version, BinaryReader r)
            {
                Contract.Requires(r != null);

                Economic  = r.ReadInt32();
                Impedence = r.ReadSingle();
                Strength  = r.ReadInt32();

                Region = r.ReadInt32();

                if (version >= eVersion.Sfc2Op)
                {
                    CartelRegion = r.ReadInt32();
                }
                else
                {
                    CartelRegion = -1;
                }

                Terrain = r.ReadInt32();
                Planet  = r.ReadInt32();
                Base    = r.ReadInt32();
            }
Exemplo n.º 7
0
            internal Styles(string styleSource, eVersion ver)
            {
                string[][] data = SSA_ASS.ParseCategory(styleSource, @"\[V4[\+]? Styles\]", typeof(eStyleFormat), (int)eStyleFormat.Prefix);

                styles = new Style[data.Length];

                if((ver & eVersion.v4ASS) != 0) {
                    for(int i = 0;i < data.Length;i++) styles[i] = new Style_ASS(data[i]);
                } else {
                    for(int i = 0;i < data.Length;i++) styles[i] = new Style_SSA(data[i]);
                }
            }
Exemplo n.º 8
0
            internal Events(string eventSource, eVersion ver)
            {
                string[][] data = ParseCategory(eventSource, @"\[Events\]", typeof(eEventFormat), (int)eEventFormat.Prefix);

                events = new Event[data.Length];
                if((ver & eVersion.v4ASS) != 0) {
                    for(int i = 0;i < data.Length;i++) events[i] = new Event_ASS(data[i]);
                } else {
                    for(int i = 0;i < data.Length;i++) events[i] = new Event_SSA(data[i]);
                }
            }