-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
5,921 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// <copyright file="DuelArea.cs" company="MUnique"> | ||
// Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
namespace MUnique.OpenMU.DataModel.Configuration; | ||
|
||
using MUnique.OpenMU.Annotations; | ||
|
||
/// <summary> | ||
/// Defines an area where a duel can take place. | ||
/// </summary> | ||
[Cloneable] | ||
public partial class DuelArea | ||
{ | ||
/// <summary> | ||
/// Gets or sets the index of the area. | ||
/// </summary> | ||
public short Index { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the first player gate to which the player is teleported when he enters the duel. | ||
/// </summary> | ||
public virtual ExitGate? FirstPlayerGate { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the second player gate to which the player is teleported when he enters the duel. | ||
/// </summary> | ||
public virtual ExitGate? SecondPlayerGate { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the gate to which a spectator is teleported when he enters the duel. | ||
/// </summary> | ||
public virtual ExitGate? SpectatorsGate { get; set; } | ||
|
||
/// <inheritdoc /> | ||
public override string ToString() | ||
{ | ||
return $"{this.Index} - {this.FirstPlayerGate} - {this.SecondPlayerGate}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// <copyright file="DuelConfiguration.cs" company="MUnique"> | ||
// Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
namespace MUnique.OpenMU.DataModel.Configuration; | ||
|
||
using MUnique.OpenMU.Annotations; | ||
|
||
/// <summary> | ||
/// Configuration for the duel feature. | ||
/// </summary> | ||
[Cloneable] | ||
public partial class DuelConfiguration | ||
{ | ||
/// <summary> | ||
/// Gets or sets the maximum score at which the duel will end with a winner. | ||
/// </summary> | ||
public int MaximumScore {get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the entrance fee for a duel. | ||
/// </summary> | ||
public int EntranceFee { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the minimum character level to start a duel. | ||
/// </summary> | ||
public int MinimumCharacterLevel { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the maximum spectators per duel room. | ||
/// </summary> | ||
public int MaximumSpectatorsPerDuelRoom { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the exit gate to which all players are ported after the duel has ended. | ||
/// If not set, players will be ported to the safezone. | ||
/// </summary> | ||
public virtual ExitGate? Exit { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the available duel areas. | ||
/// </summary> | ||
[MemberOfAggregate] | ||
public virtual ICollection<DuelArea> DuelAreas { get; protected set; } = null!; | ||
|
||
/// <inheritdoc /> | ||
public override string ToString() | ||
{ | ||
return $"Duel Configuration {this.DuelAreas.Count} Arenas, Exit: {this.Exit}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
// <copyright file="DuelArea.Generated.cs" company="MUnique"> | ||
// Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This source code was auto-generated by a roslyn code generator. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
// ReSharper disable All | ||
|
||
namespace MUnique.OpenMU.Persistence.BasicModel; | ||
|
||
using MUnique.OpenMU.Persistence.Json; | ||
|
||
/// <summary> | ||
/// A plain implementation of <see cref="DuelArea"/>. | ||
/// </summary> | ||
public partial class DuelArea : MUnique.OpenMU.DataModel.Configuration.DuelArea, IIdentifiable, IConvertibleTo<DuelArea> | ||
{ | ||
|
||
/// <summary> | ||
/// Gets or sets the identifier of this instance. | ||
/// </summary> | ||
public Guid Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the raw object of <see cref="FirstPlayerGate" />. | ||
/// </summary> | ||
[System.Text.Json.Serialization.JsonPropertyName("firstPlayerGate")] | ||
public ExitGate RawFirstPlayerGate | ||
{ | ||
get => base.FirstPlayerGate as ExitGate; | ||
set => base.FirstPlayerGate = value; | ||
} | ||
|
||
/// <inheritdoc/> | ||
[System.Text.Json.Serialization.JsonIgnore] | ||
public override MUnique.OpenMU.DataModel.Configuration.ExitGate FirstPlayerGate | ||
{ | ||
get => base.FirstPlayerGate; | ||
set => base.FirstPlayerGate = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the raw object of <see cref="SecondPlayerGate" />. | ||
/// </summary> | ||
[System.Text.Json.Serialization.JsonPropertyName("secondPlayerGate")] | ||
public ExitGate RawSecondPlayerGate | ||
{ | ||
get => base.SecondPlayerGate as ExitGate; | ||
set => base.SecondPlayerGate = value; | ||
} | ||
|
||
/// <inheritdoc/> | ||
[System.Text.Json.Serialization.JsonIgnore] | ||
public override MUnique.OpenMU.DataModel.Configuration.ExitGate SecondPlayerGate | ||
{ | ||
get => base.SecondPlayerGate; | ||
set => base.SecondPlayerGate = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the raw object of <see cref="SpectatorsGate" />. | ||
/// </summary> | ||
[System.Text.Json.Serialization.JsonPropertyName("spectatorsGate")] | ||
public ExitGate RawSpectatorsGate | ||
{ | ||
get => base.SpectatorsGate as ExitGate; | ||
set => base.SpectatorsGate = value; | ||
} | ||
|
||
/// <inheritdoc/> | ||
[System.Text.Json.Serialization.JsonIgnore] | ||
public override MUnique.OpenMU.DataModel.Configuration.ExitGate SpectatorsGate | ||
{ | ||
get => base.SpectatorsGate; | ||
set => base.SpectatorsGate = value; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override MUnique.OpenMU.DataModel.Configuration.DuelArea Clone(MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration) | ||
{ | ||
var clone = new DuelArea(); | ||
clone.AssignValuesOf(this, gameConfiguration); | ||
return clone; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void AssignValuesOf(MUnique.OpenMU.DataModel.Configuration.DuelArea other, MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration) | ||
{ | ||
base.AssignValuesOf(other, gameConfiguration); | ||
this.Id = other.GetId(); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override bool Equals(object obj) | ||
{ | ||
var baseObject = obj as IIdentifiable; | ||
if (baseObject != null) | ||
{ | ||
return baseObject.Id == this.Id; | ||
} | ||
|
||
return base.Equals(obj); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override int GetHashCode() | ||
{ | ||
return this.Id.GetHashCode(); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public DuelArea Convert() => this; | ||
} |
102 changes: 102 additions & 0 deletions
102
src/Persistence/BasicModel/DuelConfiguration.Generated.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// <copyright file="DuelConfiguration.Generated.cs" company="MUnique"> | ||
// Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This source code was auto-generated by a roslyn code generator. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
// ReSharper disable All | ||
|
||
namespace MUnique.OpenMU.Persistence.BasicModel; | ||
|
||
using MUnique.OpenMU.Persistence.Json; | ||
|
||
/// <summary> | ||
/// A plain implementation of <see cref="DuelConfiguration"/>. | ||
/// </summary> | ||
public partial class DuelConfiguration : MUnique.OpenMU.DataModel.Configuration.DuelConfiguration, IIdentifiable, IConvertibleTo<DuelConfiguration> | ||
{ | ||
|
||
/// <summary> | ||
/// Gets or sets the identifier of this instance. | ||
/// </summary> | ||
public Guid Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets the raw collection of <see cref="DuelAreas" />. | ||
/// </summary> | ||
[System.Text.Json.Serialization.JsonPropertyName("duelAreas")] | ||
public ICollection<DuelArea> RawDuelAreas { get; } = new List<DuelArea>(); | ||
|
||
/// <inheritdoc/> | ||
[System.Text.Json.Serialization.JsonIgnore] | ||
public override ICollection<MUnique.OpenMU.DataModel.Configuration.DuelArea> DuelAreas | ||
{ | ||
get => base.DuelAreas ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.DuelArea, DuelArea>(this.RawDuelAreas); | ||
protected set | ||
{ | ||
this.DuelAreas.Clear(); | ||
foreach (var item in value) | ||
{ | ||
this.DuelAreas.Add(item); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Gets the raw object of <see cref="Exit" />. | ||
/// </summary> | ||
[System.Text.Json.Serialization.JsonPropertyName("exit")] | ||
public ExitGate RawExit | ||
{ | ||
get => base.Exit as ExitGate; | ||
set => base.Exit = value; | ||
} | ||
|
||
/// <inheritdoc/> | ||
[System.Text.Json.Serialization.JsonIgnore] | ||
public override MUnique.OpenMU.DataModel.Configuration.ExitGate Exit | ||
{ | ||
get => base.Exit; | ||
set => base.Exit = value; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override MUnique.OpenMU.DataModel.Configuration.DuelConfiguration Clone(MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration) | ||
{ | ||
var clone = new DuelConfiguration(); | ||
clone.AssignValuesOf(this, gameConfiguration); | ||
return clone; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void AssignValuesOf(MUnique.OpenMU.DataModel.Configuration.DuelConfiguration other, MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration) | ||
{ | ||
base.AssignValuesOf(other, gameConfiguration); | ||
this.Id = other.GetId(); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override bool Equals(object obj) | ||
{ | ||
var baseObject = obj as IIdentifiable; | ||
if (baseObject != null) | ||
{ | ||
return baseObject.Id == this.Id; | ||
} | ||
|
||
return base.Equals(obj); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override int GetHashCode() | ||
{ | ||
return this.Id.GetHashCode(); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public DuelConfiguration Convert() => this; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.