summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-07-09 00:48:46 +0200
committerTrueDoctor <d-kobert@web.de>2018-07-09 00:48:46 +0200
commitac3f4ef1a70c4cdb538a0f0629c97bf34871a58b (patch)
tree19ba132dd5d5ca5a53830176c64f7a864b626c3c
parentdeb3640255abe60289e042944abf66bedcf1184e (diff)
Revert "Revert "Reworked inheritance structure""
This reverts commit deb3640255abe60289e042944abf66bedcf1184e.
-rw-r--r--DSALib/Class1.cs12
-rw-r--r--DSALib/DSALib.csproj53
-rw-r--r--DSALib/Properties/AssemblyInfo.cs36
-rw-r--r--DiscoBot.sln6
-rw-r--r--DiscoBot/DSA_Game/Characters/Being.cs23
-rw-r--r--DiscoBot/DSA_Game/Characters/Character.cs15
-rw-r--r--DiscoBot/DSA_Game/Characters/Combatant.cs26
-rw-r--r--DiscoBot/DSA_Game/Characters/Entity.cs18
-rw-r--r--DiscoBot/DSA_Game/Characters/ICharacter.cs19
-rw-r--r--DiscoBot/DSA_Game/Characters/NPC.cs13
-rw-r--r--DiscoBot/DiscoBot.csproj3
11 files changed, 180 insertions, 44 deletions
diff --git a/DSALib/Class1.cs b/DSALib/Class1.cs
new file mode 100644
index 0000000..13d3431
--- /dev/null
+++ b/DSALib/Class1.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DSALib
+{
+ public class Class1
+ {
+ }
+}
diff --git a/DSALib/DSALib.csproj b/DSALib/DSALib.csproj
new file mode 100644
index 0000000..35d1b00
--- /dev/null
+++ b/DSALib/DSALib.csproj
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>3f5ff9fb-53e6-4eba-85a6-f44b1dc84883</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>DSALib</RootNamespace>
+ <AssemblyName>DSALib</AssemblyName>
+ <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System"/>
+
+ <Reference Include="System.Core"/>
+ <Reference Include="System.Xml.Linq"/>
+ <Reference Include="System.Data.DataSetExtensions"/>
+
+
+ <Reference Include="Microsoft.CSharp"/>
+
+ <Reference Include="System.Data"/>
+
+ <Reference Include="System.Net.Http"/>
+
+ <Reference Include="System.Xml"/>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Class1.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ </Project>
diff --git a/DSALib/Properties/AssemblyInfo.cs b/DSALib/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..d348d14
--- /dev/null
+++ b/DSALib/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die einer Assembly zugeordnet sind.
+[assembly: AssemblyTitle("DSALib")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("DSALib")]
+[assembly: AssemblyCopyright("Copyright © 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
+// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
+// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("3f5ff9fb-53e6-4eba-85a6-f44b1dc84883")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
+// indem Sie "*" wie unten gezeigt eingeben:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/DiscoBot.sln b/DiscoBot.sln
index 0dc4781..25ae7da 100644
--- a/DiscoBot.sln
+++ b/DiscoBot.sln
@@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscoBot", "DiscoBot\DiscoBot.csproj", "{1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSALib", "DSALib\DSALib.csproj", "{3F5FF9FB-53E6-4EBA-85A6-F44B1DC84883}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -20,6 +22,10 @@ Global
{1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1186AF1C-BC46-4B3D-BEE0-CE478B8AEAC7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3F5FF9FB-53E6-4EBA-85A6-F44B1DC84883}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3F5FF9FB-53E6-4EBA-85A6-F44B1DC84883}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3F5FF9FB-53E6-4EBA-85A6-F44B1DC84883}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3F5FF9FB-53E6-4EBA-85A6-F44B1DC84883}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/DiscoBot/DSA_Game/Characters/Being.cs b/DiscoBot/DSA_Game/Characters/Being.cs
new file mode 100644
index 0000000..154e69e
--- /dev/null
+++ b/DiscoBot/DSA_Game/Characters/Being.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DiscoBot.DSA_Game.Characters
+{
+ public class Being : Entity
+ {
+ public int Lebenspunkte_Basis { get; set; } = 30;
+
+ public int Lebenspunkte_Aktuell { get; set; } = 30;
+
+ public int Ausdauer_Basis { get; set; } = 30;
+
+ public int Ausdauer_Aktuell { get; set; } = 30;
+
+ public int Astralpunkte_Basis { get; set; } = 0;
+
+ public int Astralpunkte_Aktuell { get; set; } = 0;
+ }
+}
diff --git a/DiscoBot/DSA_Game/Characters/Character.cs b/DiscoBot/DSA_Game/Characters/Character.cs
index 6616a03..c2d14eb 100644
--- a/DiscoBot/DSA_Game/Characters/Character.cs
+++ b/DiscoBot/DSA_Game/Characters/Character.cs
@@ -9,7 +9,7 @@
using DiscoBot.Audio;
using DiscoBot.Auxiliary;
- public class Character : ICharacter
+ public class Character : Being, ICharacter
{
public Character()
{
@@ -61,19 +61,6 @@
this.Post_process(); // calculate derived values
}
- public string Name { get; set; } // char name
-
- public int Lebenspunkte_Basis { get; set; }
- public int Lebenspunkte_Aktuell { get; set; }
-
- public int Astralpunkte_Basis { get; set; }
- public int Astralpunkte_Aktuell { get; set; }
-
- public int Ausdauer_Basis { get; set; }
- public int Ausdauer_Aktuell { get; set; }
-
-
-
public Dictionary<string, int> Eigenschaften { get; set; } = new Dictionary<string, int>(); // char properties
public List<Talent> Talente { get; set; } = new List<Talent>(); // list of talent objects (talents)
diff --git a/DiscoBot/DSA_Game/Characters/Combatant.cs b/DiscoBot/DSA_Game/Characters/Combatant.cs
new file mode 100644
index 0000000..a99bff9
--- /dev/null
+++ b/DiscoBot/DSA_Game/Characters/Combatant.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DiscoBot.DSA_Game.Characters
+{
+ public interface ICombatant
+ {
+ string Name { get; set; }
+
+ int Lebenspunkte_Basis { get; set; }
+ int Lebenspunkte_Aktuell { get; set; }
+
+ int Ausdauer_Basis { get; set; }
+ int Ausdauer_Aktuell { get; set; }
+
+ int Astralpunkte_Basis { get; set; }
+ int Astralpunkte_Aktuell { get; set; }
+
+ string Angriff(string talent, int erschwernis = 0);
+
+ string Parade(string talent, int erschwernis = 0);
+ }
+}
diff --git a/DiscoBot/DSA_Game/Characters/Entity.cs b/DiscoBot/DSA_Game/Characters/Entity.cs
new file mode 100644
index 0000000..f8e7a12
--- /dev/null
+++ b/DiscoBot/DSA_Game/Characters/Entity.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DiscoBot.DSA_Game.Characters
+{
+ public class Entity
+ {
+ public string Name { get; set; }
+
+ public override string ToString()
+ {
+ return this.Name;
+ }
+ }
+}
diff --git a/DiscoBot/DSA_Game/Characters/ICharacter.cs b/DiscoBot/DSA_Game/Characters/ICharacter.cs
index 3ec4258..aabebe6 100644
--- a/DiscoBot/DSA_Game/Characters/ICharacter.cs
+++ b/DiscoBot/DSA_Game/Characters/ICharacter.cs
@@ -1,28 +1,11 @@
namespace DiscoBot.DSA_Game.Characters
{
- public interface ICharacter
+ public interface ICharacter : ICombatant
{
- string Name { get; set; }
-
- int Lebenspunkte_Basis { get; set; }
- int Lebenspunkte_Aktuell { get; set; }
-
- int Ausdauer_Basis { get; set; }
- int Ausdauer_Aktuell { get; set; }
-
- int Astralpunkte_Basis { get; set; }
- int Astralpunkte_Aktuell { get; set; }
-
- //int Karmapunkte { get; set; }
-
string TestTalent(string talent, int erschwernis = 0);
string TestEigenschaft(string eigenschaft, int erschwernis = 0);
- string Angriff(string talent, int erschwernis = 0);
-
- string Parade(string talent, int erschwernis = 0);
-
string Fernkampf(string talent, int erschwernis = 0);
string TestZauber(string waffe, int erschwernis);
diff --git a/DiscoBot/DSA_Game/Characters/NPC.cs b/DiscoBot/DSA_Game/Characters/NPC.cs
index 0894df6..c135e30 100644
--- a/DiscoBot/DSA_Game/Characters/NPC.cs
+++ b/DiscoBot/DSA_Game/Characters/NPC.cs
@@ -5,7 +5,7 @@
using DiscoBot.Auxiliary;
using DiscoBot.DSA_Game.Characters;
- public class Npc : ICharacter
+ public class Npc : Being, ICharacter
{
private readonly int mean, stDv;
@@ -16,17 +16,6 @@
this.Name = name;
}
- public string Name { get; set; }
-
- public int Lebenspunkte_Basis { get; set; }
- public int Lebenspunkte_Aktuell { get; set; }
-
- public int Astralpunkte_Basis { get; set; }
- public int Astralpunkte_Aktuell { get; set; }
-
- public int Ausdauer_Basis { get; set; }
- public int Ausdauer_Aktuell { get; set; }
-
public string TestTalent(string talent, int tap = 3)
{
for (int i = 0; i <= 2; i++)
diff --git a/DiscoBot/DiscoBot.csproj b/DiscoBot/DiscoBot.csproj
index e0f8668..efadae4 100644
--- a/DiscoBot/DiscoBot.csproj
+++ b/DiscoBot/DiscoBot.csproj
@@ -104,7 +104,10 @@
<Compile Include="Auxiliary\TalentEnumerableExtension.cs" />
<Compile Include="Commands\LebenUndAstral.cs" />
<Compile Include="Commands\HeldList.cs" />
+ <Compile Include="DSA_Game\Characters\Being.cs" />
+ <Compile Include="DSA_Game\Characters\Combatant.cs" />
<Compile Include="DSA_Game\Characters\SaveChar.cs" />
+ <Compile Include="DSA_Game\Characters\Entity.cs" />
<Compile Include="DSA_Game\KampfTalent.cs" />
<Compile Include="Audio\Soundeffects.cs" />
<Compile Include="Auxiliary\Permissions.cs" />