ace/Source/ACE.Entity/ObjDesc.cs
Mag-nus 75fc1ce23c
Step 3. Convert ShardDatabase/WorldObjects biota from the ACE.Database model to the new ACE.Entity model (#2731)
* Step 1. Add new adapter classes and models

All classes and objects added are in new namespaces.

This add has 0 interraction on existing ACE code.

This sets the groundwork for Step 2. Moving World DB caching to the new models

* first part of the world entity usage

* almost there

* final part

* update WeenieExtensions

* fix

* merge fixes and improvements

* ACE.Database new code

* it compiles

* InitializePropertyDictionaries

* WOrldDatabaseWithEntityCache cleanup

* ShardDatabaseWithCaching

* ShardDatabase Cleanup

* todo

* cache counts reported in serverstatus

* House InitializePropertyDictionaries

* improve ServerStatus

* BiotaModel change HousePermissions to Dictionary<uint, bool>

* PropertiesAllegiance to dictionary

* BiotaUpdater improvements

* Shard Database Cache Reporting

* More code ported from Step 3

* Remove stub CharacterCache

* Update WorldDatabaseWithEntityCache.cs

* build fixes

* code audit

* Remove non-callback functions from SerializedShardDatabase

* BiotaUpdater progress.. only emote left

* Emotes done... now need to test

* fix

* Burden/Value fix for containers

* fat fingered EncumbranceVal

* add some safety

* Don't cache player biotas for initial PlayerManager load

* fix null spellbook

* Add another null check

This is redundant as the check is also upstream.

This is to prevent an exception in the future if this function is called from another source.
2020-04-02 22:40:27 -05:00

36 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.Linq;
using ACE.Entity.Models;
namespace ACE.Entity
{
public class ObjDesc
{
public uint PaletteID { get; set; }
public List<PropertiesPalette> SubPalettes { get; set; } = new List<PropertiesPalette>();
public List<PropertiesTextureMap> TextureChanges { get; set; } = new List<PropertiesTextureMap>();
public List<PropertiesAnimPart> AnimPartChanges { get; set; } = new List<PropertiesAnimPart>();
/// <summary>
/// Helper function to ensure we don't add redundant parts to the list
/// </summary>
public void AddTextureChange(PropertiesTextureMap tm)
{
var e = TextureChanges.FirstOrDefault(c => c.PartIndex == tm.PartIndex && c.OldTexture == tm.OldTexture && c.NewTexture == tm.NewTexture);
if (e == null)
TextureChanges.Add(tm);
}
/// <summary>
/// Helper function to ensure we only have one AnimationPartChange.PartId in the list
/// </summary>
public void AddAnimPartChange(PropertiesAnimPart ap)
{
var p = AnimPartChanges.FirstOrDefault(c => c.Index == ap.Index && c.AnimationId == ap.AnimationId);
if (p != null)
AnimPartChanges.Remove(p);
AnimPartChanges.Add(ap);
}
}
}