-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Funny-ppt/dev
阶段性更新:后端数据切换到整形、性能优化、bug修复
- Loading branch information
Showing
189 changed files
with
1,699 additions
and
914 deletions.
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
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 |
---|---|---|
|
@@ -14,6 +14,6 @@ public void NotifyUpdate() { | |
} | ||
|
||
public void AddTrigger(EventTrigger trigger) { | ||
|
||
} | ||
} |
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
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
namespace InfrastSim; | ||
|
||
public interface ISimulator | ||
{ | ||
public interface ISimulator { | ||
DateTime Now { get; } | ||
} |
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,6 @@ | ||
namespace InfrastSim.Localization; | ||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] | ||
public class AliasAttribute(Language language, string alias) : Attribute { | ||
public Language Language { get; set; } = language; | ||
public string Alias { get; set; } = alias ?? throw new ArgumentNullException(nameof(alias)); | ||
} |
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,7 @@ | ||
namespace InfrastSim.Localization; | ||
public enum Language { | ||
EN, | ||
English = EN, | ||
CN, | ||
Chinese = CN, | ||
} |
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 |
---|---|---|
@@ -1,17 +1,12 @@ | ||
namespace InfrastSim; | ||
public struct NamedValue { | ||
public string Name; | ||
public double Value; | ||
public struct NamedValue(string name, int value) { | ||
public string Name = name ?? throw new ArgumentNullException(nameof(name)); | ||
public int Value = value; | ||
|
||
public NamedValue(string name, double value) { | ||
Name = name ?? throw new ArgumentNullException(nameof(name)); | ||
Value = value; | ||
} | ||
|
||
public static implicit operator NamedValue(double value) { | ||
public static implicit operator NamedValue(int value) { | ||
return new("common", value); | ||
} | ||
public static implicit operator double(NamedValue value) { | ||
public static implicit operator int(NamedValue value) { | ||
return value.Value; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,20 +1,19 @@ | ||
namespace InfrastSim; | ||
public record Product(string Name, int Volume, int RequiredLevel, TimeSpan ProduceTime, Material[]? Consumes = null) { | ||
public readonly static Product[] CombatRecords = { | ||
public record Product( | ||
string Name, int Volume, int RequiredLevel, TimeSpan ProduceTime, Material[]? Consumes = null) { | ||
public int ProduceTicks { get; init; } = ProduceTime.ToSimuTicks(); | ||
|
||
public readonly static Product[] CombatRecords = [ | ||
new("基础作战记录", 2, 1, TimeSpan.FromMinutes(45)), | ||
new("初级作战记录", 3, 2, TimeSpan.FromMinutes(80)), | ||
new("中级作战记录", 5, 3, TimeSpan.FromMinutes(180)), | ||
}; | ||
]; | ||
public readonly static Product Gold = new("赤金", 2, 1, TimeSpan.FromMinutes(72)); | ||
public readonly static Product[] StoneFragment = { | ||
new("源石碎片", 3, 3, TimeSpan.FromMinutes(60), | ||
new[]{ new Material("龙门币", 1600), | ||
new Material("固源岩", 2),}), | ||
new("源石碎片", 3, 3, TimeSpan.FromMinutes(60), | ||
new[]{ new Material("龙门币", 1000), | ||
new Material("装置", 1),}), | ||
}; | ||
public readonly static Product[] StoneFragment = [ | ||
new("源石碎片", 3, 3, TimeSpan.FromMinutes(60), [new("龙门币", 1600), new("固源岩", 2)]), | ||
new("源石碎片", 3, 3, TimeSpan.FromMinutes(60), [new("龙门币", 1000), new("装置", 1)] | ||
), | ||
]; | ||
|
||
public readonly static Product[] AllProducts = | ||
CombatRecords.Append(Gold).Concat(StoneFragment).ToArray(); | ||
public readonly static Product[] AllProducts = [.. CombatRecords, Gold, .. StoneFragment]; | ||
} |
Oops, something went wrong.