Skip to content

Commit

Permalink
0.18.0 (no eote stuff) (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
misternebula authored May 3, 2022
1 parent f67da6f commit 77914c2
Show file tree
Hide file tree
Showing 453 changed files with 26,769 additions and 19,504 deletions.
40 changes: 6 additions & 34 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,17 @@
name: Build

on:
push:
branches: [dev]
pull_request:
workflow_dispatch:
on: push

jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["**/README.md"]'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
build:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: windows-latest
steps:

# Replace / with _ in ref name so that it can be used in a filename
- uses: mad9000/actions-find-and-replace-string@2
id: sanitizeRef
with:
source: ${{ github.ref_name }}
find: '/'
replace: '_'
# Get short-sha so that it can be used in a filename
- uses: benjlevesque/[email protected]
id: short-sha

steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: "5.0.x"
- run: dotnet build -c Release
- run: dotnet build -c Debug

- uses: actions/upload-artifact@v2
with:
name: QSB-${{ steps.sanitizeRef.outputs.value }}-${{ steps.short-sha.outputs.sha }}
path: .\QSB\Bin\Release
name: QSB
path: .\QSB\Bin\Debug
11 changes: 2 additions & 9 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>

<PropertyGroup>
<DevEnvLoc>$(MSBuildThisFileDirectory)DevEnv.targets</DevEnvLoc>
Expand All @@ -8,12 +7,10 @@

<PropertyGroup Label="Common Properties">
<TargetFramework>net48</TargetFramework>
<LangVersion>default</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>9</LangVersion>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<NeutralLanguage>en-GB</NeutralLanguage>
<Company>Henry Pointer, Aleksander Waage, Ricardo Lopes</Company>
<Copyright>Copyright © Henry Pointer, Aleksander Waage, Ricardo Lopes 2020-2021</Copyright>
</PropertyGroup>
Expand All @@ -24,10 +21,6 @@
<UnityAssetsDir>$(SolutionDir)\qsb-unityproject\Assets</UnityAssetsDir>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>
Expand Down
107 changes: 53 additions & 54 deletions EpicOnlineTransport/BidirectionalDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,82 +50,81 @@
/// MIT License
/// </summary>

namespace EpicTransport
namespace EpicTransport;

public class BidirectionalDictionary<T1, T2> : IEnumerable
{
public class BidirectionalDictionary<T1, T2> : IEnumerable
{
private Dictionary<T1, T2> t1ToT2Dict = new Dictionary<T1, T2>();
private Dictionary<T2, T1> t2ToT1Dict = new Dictionary<T2, T1>();
private Dictionary<T1, T2> t1ToT2Dict = new();
private Dictionary<T2, T1> t2ToT1Dict = new();

public IEnumerable<T1> FirstTypes => t1ToT2Dict.Keys;
public IEnumerable<T2> SecondTypes => t2ToT1Dict.Keys;
public IEnumerable<T1> FirstTypes => t1ToT2Dict.Keys;
public IEnumerable<T2> SecondTypes => t2ToT1Dict.Keys;

public IEnumerator GetEnumerator() => t1ToT2Dict.GetEnumerator();
public IEnumerator GetEnumerator() => t1ToT2Dict.GetEnumerator();

public int Count => t1ToT2Dict.Count;
public int Count => t1ToT2Dict.Count;

public void Add(T1 key, T2 value)
{
t1ToT2Dict[key] = value;
t2ToT1Dict[value] = key;
}
public void Add(T1 key, T2 value)
{
t1ToT2Dict[key] = value;
t2ToT1Dict[value] = key;
}

public void Add(T2 key, T1 value)
{
t2ToT1Dict[key] = value;
t1ToT2Dict[value] = key;
}
public void Add(T2 key, T1 value)
{
t2ToT1Dict[key] = value;
t1ToT2Dict[value] = key;
}

public T2 Get(T1 key) => t1ToT2Dict[key];
public T2 Get(T1 key) => t1ToT2Dict[key];

public T1 Get(T2 key) => t2ToT1Dict[key];
public T1 Get(T2 key) => t2ToT1Dict[key];

public bool TryGetValue(T1 key, out T2 value) => t1ToT2Dict.TryGetValue(key, out value);
public bool TryGetValue(T1 key, out T2 value) => t1ToT2Dict.TryGetValue(key, out value);

public bool TryGetValue(T2 key, out T1 value) => t2ToT1Dict.TryGetValue(key, out value);
public bool TryGetValue(T2 key, out T1 value) => t2ToT1Dict.TryGetValue(key, out value);

public bool Contains(T1 key) => t1ToT2Dict.ContainsKey(key);
public bool Contains(T1 key) => t1ToT2Dict.ContainsKey(key);

public bool Contains(T2 key) => t2ToT1Dict.ContainsKey(key);
public bool Contains(T2 key) => t2ToT1Dict.ContainsKey(key);

public void Remove(T1 key)
public void Remove(T1 key)
{
if (Contains(key))
{
if (Contains(key))
{
T2 val = t1ToT2Dict[key];
t1ToT2Dict.Remove(key);
t2ToT1Dict.Remove(val);
}
var val = t1ToT2Dict[key];
t1ToT2Dict.Remove(key);
t2ToT1Dict.Remove(val);
}
}

public void Remove(T2 key)
public void Remove(T2 key)
{
if (Contains(key))
{
if (Contains(key))
{
T1 val = t2ToT1Dict[key];
t1ToT2Dict.Remove(val);
t2ToT1Dict.Remove(key);
}
var val = t2ToT1Dict[key];
t1ToT2Dict.Remove(val);
t2ToT1Dict.Remove(key);
}
}

public T1 this[T2 key]
public T1 this[T2 key]
{
get => t2ToT1Dict[key];
set
{
get => t2ToT1Dict[key];
set
{
t2ToT1Dict[key] = value;
t1ToT2Dict[value] = key;
}
t2ToT1Dict[key] = value;
t1ToT2Dict[value] = key;
}
}

public T2 this[T1 key]
public T2 this[T1 key]
{
get => t1ToT2Dict[key];
set
{
get => t1ToT2Dict[key];
set
{
t1ToT2Dict[key] = value;
t2ToT1Dict[value] = key;
}
t1ToT2Dict[key] = value;
t2ToT1Dict[value] = key;
}
}
}
}
Loading

0 comments on commit 77914c2

Please sign in to comment.