Skip to content

Commit 9c8b687

Browse files
committed
WIP AUTUMN 2.0 + redo directory layout
AUTUMN 2.0 is still in very early stages, being a complete rewrite of AUTUMN with at most a few functions copied along.
1 parent dd1b753 commit 9c8b687

File tree

10 files changed

+731
-66
lines changed

10 files changed

+731
-66
lines changed

AUTUMN v2/Core.cs

Lines changed: 590 additions & 0 deletions
Large diffs are not rendered by default.

AUTUMN v2/Functions.cs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using Sandbox.ModAPI.Ingame;
5+
6+
namespace SpaceEngineersScripting
7+
{
8+
class CodeEditorEmulator
9+
{
10+
IMyGridTerminalSystem GridTerminalSystem = null;
11+
string Storage;
12+
13+
// - - - Code start - - - \\
14+
15+
void Main(string argument)
16+
{
17+
}
18+
19+
static class Functions
20+
{
21+
public static string getDamageReportString(bool listOfflineBlocks)
22+
{
23+
StringBuilder report = new StringBuilder();
24+
25+
return report.ToString();
26+
}
27+
class DamageReport
28+
{
29+
public int brokenBlockCount, offlineBlockCount = 0;
30+
public List<IMyTerminalBlock> BrokenBlocks { get; set; }
31+
}
32+
public static DamageReport getDamageReport(bool listOfflineBlocks, IMyGridTerminalSystem GridTerminalSystem)
33+
{
34+
DamageReport dmgReportToReturn = new DamageReport();
35+
List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
36+
GridTerminalSystem.GetBlocks(blocks);
37+
for (int i = 0; i < blocks.Count; i++)
38+
{
39+
if (!blocks[i].IsFunctional)
40+
{
41+
42+
dmgReportToReturn.brokenBlockCount++;
43+
codeBlue = true; //Alert for damaged blocks
44+
debugOutput("set codeOrange to " + codeOrange.ToString());
45+
}
46+
if (!GridTerminalSystem.Blocks[i].IsWorking && GridTerminalSystem.Blocks[i].IsFunctional)
47+
{
48+
if (listOfflineBlocks)
49+
{
50+
report.AppendFormat("\n -{0} is offline.", GridTerminalSystem.Blocks[i].DisplayNameText);
51+
}
52+
offlineBlockCount++;
53+
}
54+
}
55+
if (brokenBlockCount < 1 && codeBlue)
56+
{
57+
codeBlue = false; //Turn off alarm again
58+
}
59+
60+
return dmgReportToReturn;
61+
}
62+
63+
64+
}
65+
}
66+
}

App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
5+
</startup>
6+
</configuration>

Program.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Project_AUTUMN
8+
{
9+
class Program
10+
{
11+
static void Main(string[] args)
12+
{
13+
}
14+
}
15+
}

Project AUTUMN.csproj

Lines changed: 9 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{E0D7AE07-D1B9-4F5E-A293-083030AA8217}</ProjectGuid>
8-
<OutputType>WinExe</OutputType>
7+
<ProjectGuid>{02B752D3-E0D1-485A-BA2C-D7DEFDFE43BE}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>SESandbox</RootNamespace>
11-
<AssemblyName>SESandbox</AssemblyName>
10+
<RootNamespace>Project_AUTUMN</RootNamespace>
11+
<AssemblyName>Project AUTUMN</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
</PropertyGroup>
@@ -32,69 +32,21 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35-
<Reference Include="Sandbox.Common">
36-
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Bin64\Sandbox.Common.dll</HintPath>
37-
</Reference>
38-
<Reference Include="Sandbox.Common.XmlSerializers">
39-
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Bin64\Sandbox.Common.XmlSerializers.dll</HintPath>
40-
</Reference>
41-
<Reference Include="Sandbox.Game">
42-
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Bin64\Sandbox.Game.dll</HintPath>
43-
</Reference>
44-
<Reference Include="Sandbox.Graphics">
45-
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Bin64\Sandbox.Graphics.dll</HintPath>
46-
</Reference>
4735
<Reference Include="System" />
4836
<Reference Include="System.Core" />
4937
<Reference Include="System.Xml.Linq" />
5038
<Reference Include="System.Data.DataSetExtensions" />
5139
<Reference Include="Microsoft.CSharp" />
5240
<Reference Include="System.Data" />
53-
<Reference Include="System.Deployment" />
54-
<Reference Include="System.Drawing" />
55-
<Reference Include="System.Windows.Forms" />
5641
<Reference Include="System.Xml" />
57-
<Reference Include="VRage">
58-
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Bin64\VRage.dll</HintPath>
59-
</Reference>
60-
<Reference Include="VRage.Common">
61-
<HintPath>D:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64\VRage.Common.dll</HintPath>
62-
</Reference>
63-
<Reference Include="VRage.Library">
64-
<HintPath>..\..\..\..\..\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Bin64\VRage.Library.dll</HintPath>
65-
</Reference>
66-
<Reference Include="VRage.Math">
67-
<HintPath>D:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64\VRage.Math.dll</HintPath>
68-
</Reference>
69-
<Reference Include="VRage.Render">
70-
<HintPath>D:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64\VRage.Render.dll</HintPath>
71-
</Reference>
7242
</ItemGroup>
7343
<ItemGroup>
44+
<Compile Include="Program.cs" />
7445
<Compile Include="Properties\AssemblyInfo.cs" />
75-
<Compile Include="ShipAI Core.cs" />
76-
<Compile Include="ShipAI Interaction Module.cs" />
77-
<Compile Include="ShipAI Screens module.cs" />
78-
<EmbeddedResource Include="Properties\Resources.resx">
79-
<Generator>ResXFileCodeGenerator</Generator>
80-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
81-
<SubType>Designer</SubType>
82-
</EmbeddedResource>
83-
<Compile Include="Properties\Resources.Designer.cs">
84-
<AutoGen>True</AutoGen>
85-
<DependentUpon>Resources.resx</DependentUpon>
86-
</Compile>
87-
<None Include="Properties\Settings.settings">
88-
<Generator>SettingsSingleFileGenerator</Generator>
89-
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
90-
</None>
91-
<Compile Include="Properties\Settings.Designer.cs">
92-
<AutoGen>True</AutoGen>
93-
<DependentUpon>Settings.settings</DependentUpon>
94-
<DesignTimeSharedInput>True</DesignTimeSharedInput>
95-
</Compile>
9646
</ItemGroup>
97-
<ItemGroup />
47+
<ItemGroup>
48+
<None Include="App.config" />
49+
</ItemGroup>
9850
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9951
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
10052
Other similar extension points exist, see Microsoft.Common.targets.

Project AUTUMN.sln

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project AUTUMN", "Project AUTUMN.csproj", "{E0D7AE07-D1B9-4F5E-A293-083030AA8217}"
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project AUTUMN", "Project AUTUMN.csproj", "{02B752D3-E0D1-485A-BA2C-D7DEFDFE43BE}"
75
EndProject
86
Global
97
GlobalSection(SolutionConfigurationPlatforms) = preSolution
108
Debug|Any CPU = Debug|Any CPU
119
Release|Any CPU = Release|Any CPU
1210
EndGlobalSection
1311
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{E0D7AE07-D1B9-4F5E-A293-083030AA8217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{E0D7AE07-D1B9-4F5E-A293-083030AA8217}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{E0D7AE07-D1B9-4F5E-A293-083030AA8217}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{E0D7AE07-D1B9-4F5E-A293-083030AA8217}.Release|Any CPU.Build.0 = Release|Any CPU
12+
{02B752D3-E0D1-485A-BA2C-D7DEFDFE43BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{02B752D3-E0D1-485A-BA2C-D7DEFDFE43BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{02B752D3-E0D1-485A-BA2C-D7DEFDFE43BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{02B752D3-E0D1-485A-BA2C-D7DEFDFE43BE}.Release|Any CPU.Build.0 = Release|Any CPU
1816
EndGlobalSection
1917
GlobalSection(SolutionProperties) = preSolution
2018
HideSolutionNode = FALSE

Properties/AssemblyInfo.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Project AUTUMN")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Microsoft")]
12+
[assembly: AssemblyProduct("Project AUTUMN")]
13+
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("a597d711-be85-4fa4-bd72-4291bdca706c")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

ShipAI Core.cs renamed to ShipAI v1/ShipAI Core.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ void Main()
5454
if (!VUM.isScreenModulePresent)
5555
{
5656
debugOutput("No Screen module found, printing to status panels from core..");
57-
VUM.updateStatusPanels(); //Turn this off if you have the AI Screen Module.
57+
VUM.updateStatusPanels();
5858
}
59+
5960

6061

6162
//Management modules are below here. Things like power management, turret management, etc.
@@ -86,6 +87,7 @@ void Main()
8687
VUM.flushVariables();
8788
}
8889

90+
8991
public static bool isHealthy(IMyTerminalBlock block)
9092
{
9193
return (block.IsFunctional && block.IsWorking);
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)