public override int WriteTo(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.WriteTo(Buffer, cursor); cursor += LightShading.WriteTo(Buffer, cursor); return(cursor - StartIndex); }
public override int ReadFrom(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.ReadFrom(Buffer, cursor); LightShading = new LightShading(Buffer, cursor); cursor += LightShading.ByteLength; return(cursor - StartIndex); }
public override int ReadFrom(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.ReadFrom(Buffer, cursor); LightShading = new LightShading(Buffer, cursor); cursor += LightShading.ByteLength; return cursor - StartIndex; }
/// <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); avatarQuests = 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<ServerString>(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 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(); adminInfo = new AdminInfo(); tradeInfo = new TradeInfo(); buyInfo = new BuyInfo(); welcomeInfo = new WelcomeInfo(); charCreationInfo = new CharCreationInfo(); statChangeInfo = new StatChangeInfo(); newsGroup = new NewsGroup(); objectContents = new ObjectContents(); effects = new Effects(); lookPlayer = new PlayerInfo(); lookObject = new ObjectInfo(); clientPreferences = new PreferencesFlags(); // 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; }
public LightShadingMessage(LightShading LightShading) : base(MessageTypeGameMode.LightShading) { this.LightShading = LightShading; }