-
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.
Add Project and update README.md and .gitattributes
Add Project and update README.md and .gitattributes.
- Loading branch information
Showing
17 changed files
with
1,879 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain | ||
|
||
# Binary files | ||
*.class binary | ||
*.dll binary | ||
*.ear binary | ||
*.gif binary | ||
*.ico binary | ||
*.jar binary | ||
*.jpg binary | ||
*.jpeg binary | ||
*.png binary | ||
*.so binary | ||
*.war binary |
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,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26430.6 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NerdyAion", "NerdyAion\NerdyAion.csproj", "{A7DA8196-45F9-4D64-AB0D-9160D50A585D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{A7DA8196-45F9-4D64-AB0D-9160D50A585D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A7DA8196-45F9-4D64-AB0D-9160D50A585D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A7DA8196-45F9-4D64-AB0D-9160D50A585D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A7DA8196-45F9-4D64-AB0D-9160D50A585D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
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,143 @@ | ||
// Copyright (C) 2019 Sebastian Lühnen | ||
// | ||
// | ||
// This file is part of NerdyAion. | ||
// | ||
// NerdyAion is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// NerdyAion is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with NerdyAion. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
// | ||
// Created By: Sebastian Lühnen | ||
// Created On: 19.02.2019 | ||
// Last Edited On: 18.03.2019 | ||
// Language: C# | ||
// | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.RegularExpressions; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NerdyAion | ||
{ | ||
public class AnalysisTemplate | ||
{ | ||
private String strucktor; | ||
private String template; | ||
/* | ||
* Supported variables: | ||
* eventSource | ||
* eventTarget | ||
* eventEffect | ||
* eventName | ||
* eventEffectExtra | ||
* eventTarget_eventEffect | ||
* eventName_eventEffect | ||
*/ | ||
private Dictionary<String, String> variables; | ||
private Boolean damageEvent; | ||
|
||
public String Strucktor | ||
{ | ||
get { return strucktor; } | ||
set { strucktor = value; } | ||
} | ||
public String Template | ||
{ | ||
get { return template; } | ||
set { template = value; } | ||
} | ||
public Dictionary<String, String> Variables | ||
{ | ||
get { return variables; } | ||
set { variables = value; } | ||
} | ||
public Boolean DamageEvent | ||
{ | ||
get { return damageEvent; } | ||
set { damageEvent = value; } | ||
} | ||
|
||
public AnalysisTemplate() | ||
{ | ||
Strucktor = ""; | ||
Template = ""; | ||
Variables = new Dictionary<string, string>(); | ||
DamageEvent = false; | ||
} | ||
|
||
public void AddVariable(String variable) | ||
{ | ||
Variables.Add(variable, variable); | ||
} | ||
|
||
public String GetEventSource(Match result) | ||
{ | ||
return result.Groups[Variables["eventSource"]].Value; | ||
} | ||
|
||
public String GetEventTarget(Match result) | ||
{ | ||
if (Variables.ContainsKey("eventTarget_eventEffect")) | ||
{ | ||
return SplitEventTargetAndEventEffect(result)[0]; | ||
} | ||
return result.Groups[Variables["eventTarget"]].Value; | ||
} | ||
|
||
public String GetEventName(Match result) | ||
{ | ||
if (Variables.ContainsKey("eventName_eventEffect")) | ||
{ | ||
return SplitEventNameAndEventEffect(result)[0]; | ||
} | ||
return result.Groups[Variables["eventName"]].Value; | ||
} | ||
|
||
public long GetEventEffect(Match result) | ||
{ | ||
if (Variables.ContainsKey("eventTarget_eventEffect")) | ||
{ | ||
return Convert.ToInt64(SplitEventTargetAndEventEffect(result)[1].Replace(".", "")); | ||
} | ||
else if (Variables.ContainsKey("eventName_eventEffect")) | ||
{ | ||
return Convert.ToInt64(SplitEventNameAndEventEffect(result)[1].Replace(".", "")); | ||
} | ||
|
||
return Convert.ToInt64(result.Groups[Variables["eventEffect"]].Value.Replace(".", "")); | ||
} | ||
|
||
public String GetEventEffectExtra(Match result) | ||
{ | ||
return result.Groups[Variables["eventEffectExtra"]].Value; | ||
} | ||
|
||
private String[] SplitEventTargetAndEventEffect(Match result) | ||
{ | ||
Regex pattern = new Regex(@"(?<eventTarget>[^,]+) (?<eventEffect>[.0-9]+)"); | ||
Match match = pattern.Match(result.Groups[variables["eventTarget_eventEffect"]].Value); | ||
|
||
return new String[] { match.Groups["eventTarget"].Value, match.Groups["eventEffect"].Value }; | ||
} | ||
|
||
private String[] SplitEventNameAndEventEffect(Match result) | ||
{ | ||
Regex pattern = new Regex(@"(?<eventName>[^,]+) (?<eventEffect>[.0-9]+)"); | ||
Match match = pattern.Match(result.Groups[variables["eventName_eventEffect"]].Value); | ||
|
||
return new String[] { match.Groups["eventName"].Value, match.Groups["eventEffect"].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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | ||
</startup> | ||
</configuration> |
Oops, something went wrong.