Beispiel #1
0
        public override void Load(FileReader stream)
        {
            base.Load(stream);

            MapX = stream.ReadInt16();
            MapY = stream.ReadInt16();
            MapW = stream.ReadInt16();
            MapH = stream.ReadInt16();

            Type = RoomRegistry.FromIndex(stream.ReadByte());

            var count = stream.ReadByte();

            for (var i = 0; i < count; i++)
            {
                var c = RoomControllerRegistery.Get(stream.ReadString());

                if (c != null)
                {
                    Controllers.Add(c);
                    c.Room = this;
                    c.Load(stream);
                }
            }

            Id = stream.ReadString();
        }
Beispiel #2
0
        public void AddController(string id)
        {
            var c = RoomControllerRegistery.Get(id);

            if (c != null)
            {
                Controllers.Add(c);
                c.Room = this;
                c.Init();
            }
        }