Merged PR 212: Optimize FindChildrenById from O(n) to O(1)

Optimize FindChildrenById from O(n) to O(1):
- Deprecate FindContainerByIdDFS
- Container: Replace Children to string[]
- Add HashMap to IHistoryState that contains all containers

To access a container by id now cost O(1) without any additional cost

+ Implement CICD for SVGLibs
This commit is contained in:
Eric Nguyen 2022-10-12 09:39:54 +00:00
parent 466ef2b08b
commit c256a76e01
45 changed files with 775 additions and 450 deletions

View file

@ -1,26 +1,29 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class ApplicationStateModel
{
[DataMember(EmitDefaultValue = false)]
public string lastAction;
[DataMember(EmitDefaultValue = false)]
public ContainerModel mainContainer;
[DataMember(EmitDefaultValue = false)]
public string selectedContainerId;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, string> typeCounters;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, SymbolModel> symbols;
[DataMember(EmitDefaultValue = false)]
public string selectedSymbolId;
}
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class ApplicationStateModel
{
[DataMember(EmitDefaultValue = false)]
public string lastAction;
[DataMember(EmitDefaultValue = false)]
public string mainContainer;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, ContainerModel> containers;
[DataMember(EmitDefaultValue = false)]
public string selectedContainerId;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, string> typeCounters;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, SymbolModel> symbols;
[DataMember(EmitDefaultValue = false)]
public string selectedSymbolId;
}
}

View file

@ -1,17 +1,17 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class ContainerModel
{
[DataMember(EmitDefaultValue = false)]
public List<ContainerModel> children;
[DataMember(EmitDefaultValue = false)]
public ContainerProperties properties;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, string> userData;
}
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SVGLDLibs.Models
{
public class ContainerModel
{
[DataMember(EmitDefaultValue = false)]
public List<string> children;
[DataMember(EmitDefaultValue = false)]
public ContainerProperties properties;
[DataMember(EmitDefaultValue = false)]
public Dictionary<string, string> userData;
}
}