コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public DataController()
        {
            // create lists
            RoomObjects = new RoomObjectList(300);
            RoomObjectsFiltered = new RoomObjectListFiltered(RoomObjects);
            Projectiles = new ProjectileList(50);
            OnlinePlayers = new OnlinePlayerList(200);
            InventoryObjects = new InventoryObjectList(100);
            AvatarCondition = new StatNumericList(5);
            AvatarAttributes = new StatNumericList(10);
            AvatarSkills = new SkillList(100);
            AvatarSpells = new SkillList(100);
            RoomBuffs = new ObjectBaseList<ObjectBase>(30);
            AvatarBuffs = new ObjectBaseList<ObjectBase>(30);
            SpellObjects = new SpellObjectList(100);
            BackgroundOverlays = new BackgroundOverlayList(5);
            PlayerOverlays = new ObjectBaseList<PlayerOverlay>(10);
            ChatMessages = new BaseList<ChatMessage>(101);
            GameMessageLog = new BaseList<GameMessage>(100);
            VisitedTargets = new List<RoomObject>(50);
            ClickedTargets = new List<uint>(50);
            ActionButtons = new ActionButtonList();
            IgnoreList = new List<string>(20);
            ChatCommandHistory = new List<string>(20);

            // attach some listeners
            RoomObjects.ListChanged += OnRoomObjectsListChanged;
            Projectiles.ListChanged += OnProjectilesListChanged;
            ChatMessages.ListChanged += OnChatMessagesListChanged;

            // make some lists sorted
            OnlinePlayers.SortByName();
            AvatarSkills.SortByResourceName();
            AvatarSpells.SortByResourceName();
            SpellObjects.SortByName();

            // create single data objects
            Effects = new Effects();
            RoomInformation = new RoomInfo();
            LightShading = new LightShading(0, new SpherePosition(0, 0));
            BackgroundMusic = new PlayMusic();
            GuildInfo = new GuildInfo();
            GuildShieldInfo = new GuildShieldInfo();
            GuildAskData = new GuildAskData();
            DiplomacyInfo = new DiplomacyInfo();
            LookObject = new ObjectInfo();
            LookPlayer = new PlayerInfo();
            NewsGroup = new NewsGroup();
            Trade = new TradeInfo();
            Buy = new BuyInfo();
            WelcomeInfo = new WelcomeInfo();
            CharCreationInfo = new CharCreationInfo();
            ObjectContents = new ObjectContents();
            StatChangeInfo = new StatChangeInfo();

            // some values
            ChatMessagesMaximum = 100;
            ChatCommandHistoryMaximum = 20;
            ChatCommandHistoryIndex = -1;
            AvatarObject = null;
            IsResting = false;
            SelfTarget = false;
            IsNextAttackApplyCastOnHighlightedObject = false;
            AvatarID = UInt32.MaxValue;
            TargetID = UInt32.MaxValue;
            ViewerPosition = V3.ZERO;
            UIMode = UIMode.None;
        }