tidy projectfiles, Map

This commit is contained in:
Chris Forbes
2011-10-30 10:08:51 +13:00
parent c50aae25d3
commit 8111ccbea6
3 changed files with 26 additions and 26 deletions

View File

@@ -22,11 +22,11 @@ namespace OpenRA
{ {
public class Map public class Map
{ {
[FieldLoader.Ignore] protected IFolder Container; [FieldLoader.Ignore] IFolder Container;
public string Path {get; protected set;} public string Path { get; private set; }
// Yaml map data // Yaml map data
public string Uid { get; protected set; } public string Uid { get; private set; }
public int MapFormat; public int MapFormat;
public bool Selectable; public bool Selectable;
public bool UseAsShellmap; public bool UseAsShellmap;
@@ -162,8 +162,8 @@ namespace OpenRA
var ret = new List<SmudgeReference>(); var ret = new List<SmudgeReference>();
foreach (var kv in yaml.NodesDict["Smudges"].NodesDict) foreach (var kv in yaml.NodesDict["Smudges"].NodesDict)
{ {
string[] vals = kv.Key.Split(' '); var vals = kv.Key.Split(' ');
string[] loc = vals[1].Split(','); var loc = vals[1].Split(',');
ret.Add(new SmudgeReference(vals[0], new int2(int.Parse(loc[0]), int.Parse(loc[1])), int.Parse(vals[2]))); ret.Add(new SmudgeReference(vals[0], new int2(int.Parse(loc[0]), int.Parse(loc[1])), int.Parse(vals[2])));
} }
@@ -194,7 +194,7 @@ namespace OpenRA
MapFormat = 5; MapFormat = 5;
var root = new List<MiniYamlNode>(); var root = new List<MiniYamlNode>();
var fields = new string[] var fields = new []
{ {
"Selectable", "Selectable",
"MapFormat", "MapFormat",
@@ -232,7 +232,7 @@ namespace OpenRA
root.Add(new MiniYamlNode("Weapons", null, Weapons)); root.Add(new MiniYamlNode("Weapons", null, Weapons));
root.Add(new MiniYamlNode("Voices", null, Voices)); root.Add(new MiniYamlNode("Voices", null, Voices));
Dictionary<string, byte[]> entries = new Dictionary<string, byte[]>(); var entries = new Dictionary<string, byte[]>();
entries.Add("map.bin", SaveBinaryData()); entries.Add("map.bin", SaveBinaryData());
var s = root.WriteToString(); var s = root.WriteToString();
entries.Add("map.yaml", Encoding.UTF8.GetBytes(s)); entries.Add("map.yaml", Encoding.UTF8.GetBytes(s));
@@ -319,8 +319,8 @@ namespace OpenRA
ReadByte(dataStream); ReadByte(dataStream);
// Load resource data // Load resource data
for (int i = 0; i < MapSize.X; i++) for (var i = 0; i < MapSize.X; i++)
for (int j = 0; j < MapSize.Y; j++) for (var j = 0; j < MapSize.Y; j++)
{ {
byte type = ReadByte(dataStream); byte type = ReadByte(dataStream);
byte index = ReadByte(dataStream); byte index = ReadByte(dataStream);
@@ -332,7 +332,7 @@ namespace OpenRA
public byte[] SaveBinaryData() public byte[] SaveBinaryData()
{ {
MemoryStream dataStream = new MemoryStream(); var dataStream = new MemoryStream();
using (var writer = new BinaryWriter(dataStream)) using (var writer = new BinaryWriter(dataStream))
{ {
// File header consists of a version byte, followed by 2 ushorts for width and height // File header consists of a version byte, followed by 2 ushorts for width and height
@@ -346,8 +346,8 @@ namespace OpenRA
.F(Tileset, string.Join(",", OpenRA.Rules.TileSets.Keys.ToArray()))); .F(Tileset, string.Join(",", OpenRA.Rules.TileSets.Keys.ToArray())));
// Tile data // Tile data
for (int i = 0; i < MapSize.X; i++) for (var i = 0; i < MapSize.X; i++)
for (int j = 0; j < MapSize.Y; j++) for (var j = 0; j < MapSize.Y; j++)
{ {
writer.Write(MapTiles.Value[i, j].type); writer.Write(MapTiles.Value[i, j].type);
var PickAny = OpenRA.Rules.TileSets[Tileset].Templates[MapTiles.Value[i, j].type].PickAny; var PickAny = OpenRA.Rules.TileSets[Tileset].Templates[MapTiles.Value[i, j].type].PickAny;
@@ -355,8 +355,8 @@ namespace OpenRA
} }
// Resource data // Resource data
for (int i = 0; i < MapSize.X; i++) for (var i = 0; i < MapSize.X; i++)
for (int j = 0; j < MapSize.Y; j++) for (var j = 0; j < MapSize.Y; j++)
{ {
writer.Write(MapResources.Value[i, j].type); writer.Write(MapResources.Value[i, j].type);
writer.Write(MapResources.Value[i, j].index); writer.Write(MapResources.Value[i, j].index);

View File

@@ -124,6 +124,7 @@
<Compile Include="Network\Order.cs" /> <Compile Include="Network\Order.cs" />
<Compile Include="Network\OrderIO.cs" /> <Compile Include="Network\OrderIO.cs" />
<Compile Include="Network\OrderManager.cs" /> <Compile Include="Network\OrderManager.cs" />
<Compile Include="Network\Replay.cs" />
<Compile Include="Network\ReplayConnection.cs" /> <Compile Include="Network\ReplayConnection.cs" />
<Compile Include="Network\ServerList.cs" /> <Compile Include="Network\ServerList.cs" />
<Compile Include="Network\Session.cs" /> <Compile Include="Network\Session.cs" />
@@ -161,6 +162,7 @@
<Compile Include="Traits\Render\RenderSimple.cs" /> <Compile Include="Traits\Render\RenderSimple.cs" />
<Compile Include="Traits\RevealsShroud.cs" /> <Compile Include="Traits\RevealsShroud.cs" />
<Compile Include="Traits\Selectable.cs" /> <Compile Include="Traits\Selectable.cs" />
<Compile Include="Traits\SelectionDecorations.cs" />
<Compile Include="Traits\SubcellInit.cs" /> <Compile Include="Traits\SubcellInit.cs" />
<Compile Include="Traits\Target.cs" /> <Compile Include="Traits\Target.cs" />
<Compile Include="Traits\TraitsInterfaces.cs" /> <Compile Include="Traits\TraitsInterfaces.cs" />
@@ -182,12 +184,15 @@
<Compile Include="Widgets\ChromeMetrics.cs" /> <Compile Include="Widgets\ChromeMetrics.cs" />
<Compile Include="Widgets\ColorBlockWidget.cs" /> <Compile Include="Widgets\ColorBlockWidget.cs" />
<Compile Include="Widgets\DropDownButtonWidget.cs" /> <Compile Include="Widgets\DropDownButtonWidget.cs" />
<Compile Include="Widgets\GridLayout.cs" />
<Compile Include="Widgets\ImageWidget.cs" /> <Compile Include="Widgets\ImageWidget.cs" />
<Compile Include="Widgets\LabelWidget.cs" /> <Compile Include="Widgets\LabelWidget.cs" />
<Compile Include="Widgets\ListLayout.cs" />
<Compile Include="Widgets\MapPreviewWidget.cs" /> <Compile Include="Widgets\MapPreviewWidget.cs" />
<Compile Include="Widgets\PasswordFieldWidget.cs" /> <Compile Include="Widgets\PasswordFieldWidget.cs" />
<Compile Include="Widgets\PerfGraphWidget.cs" /> <Compile Include="Widgets\PerfGraphWidget.cs" />
<Compile Include="Widgets\ProgressBarWidget.cs" /> <Compile Include="Widgets\ProgressBarWidget.cs" />
<Compile Include="Widgets\ScrollItemWidget.cs" />
<Compile Include="Widgets\ScrollPanelWidget.cs" /> <Compile Include="Widgets\ScrollPanelWidget.cs" />
<Compile Include="Widgets\ShpImageWidget.cs" /> <Compile Include="Widgets\ShpImageWidget.cs" />
<Compile Include="Widgets\SliderWidget.cs" /> <Compile Include="Widgets\SliderWidget.cs" />
@@ -201,11 +206,6 @@
<Compile Include="Widgets\WorldInteractionControllerWidget.cs" /> <Compile Include="Widgets\WorldInteractionControllerWidget.cs" />
<Compile Include="World.cs" /> <Compile Include="World.cs" />
<Compile Include="WorldUtils.cs" /> <Compile Include="WorldUtils.cs" />
<Compile Include="Widgets\ScrollItemWidget.cs" />
<Compile Include="Widgets\ListLayout.cs" />
<Compile Include="Widgets\GridLayout.cs" />
<Compile Include="Network\Replay.cs" />
<Compile Include="Traits\SelectionDecorations.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj"> <ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
@@ -241,4 +241,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -56,6 +56,8 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AI\BaseBuilder.cs" />
<Compile Include="AI\HackyAI.cs" />
<Compile Include="AcceptsSupplies.cs" /> <Compile Include="AcceptsSupplies.cs" />
<Compile Include="Activities\Attack.cs" /> <Compile Include="Activities\Attack.cs" />
<Compile Include="Activities\CallFunc.cs" /> <Compile Include="Activities\CallFunc.cs" />
@@ -273,6 +275,7 @@
<Compile Include="Render\RenderFlare.cs" /> <Compile Include="Render\RenderFlare.cs" />
<Compile Include="Render\RenderHarvester.cs" /> <Compile Include="Render\RenderHarvester.cs" />
<Compile Include="Render\RenderInfantry.cs" /> <Compile Include="Render\RenderInfantry.cs" />
<Compile Include="Render\RenderInfantryPanic.cs" />
<Compile Include="Render\RenderSpy.cs" /> <Compile Include="Render\RenderSpy.cs" />
<Compile Include="Render\RenderUnit.cs" /> <Compile Include="Render\RenderUnit.cs" />
<Compile Include="Render\RenderUnitReload.cs" /> <Compile Include="Render\RenderUnitReload.cs" />
@@ -333,16 +336,18 @@
<Compile Include="Widgets\Logic\CreateServerMenuLogic.cs" /> <Compile Include="Widgets\Logic\CreateServerMenuLogic.cs" />
<Compile Include="Widgets\Logic\DeveloperModeLogic.cs" /> <Compile Include="Widgets\Logic\DeveloperModeLogic.cs" />
<Compile Include="Widgets\Logic\DiplomacyLogic.cs" /> <Compile Include="Widgets\Logic\DiplomacyLogic.cs" />
<Compile Include="Widgets\Logic\DirectConnectLogic.cs" />
<Compile Include="Widgets\Logic\DownloadPackagesLogic.cs" />
<Compile Include="Widgets\Logic\IngameChromeLogic.cs" /> <Compile Include="Widgets\Logic\IngameChromeLogic.cs" />
<Compile Include="Widgets\Logic\IngameObserverChromeLogic.cs" /> <Compile Include="Widgets\Logic\IngameObserverChromeLogic.cs" />
<Compile Include="Widgets\Logic\LobbyLogic.cs" /> <Compile Include="Widgets\Logic\LobbyLogic.cs" />
<Compile Include="Widgets\Logic\LobbyUtils.cs" />
<Compile Include="Widgets\Logic\MainMenuButtonsLogic.cs" /> <Compile Include="Widgets\Logic\MainMenuButtonsLogic.cs" />
<Compile Include="Widgets\Logic\MapChooserLogic.cs" /> <Compile Include="Widgets\Logic\MapChooserLogic.cs" />
<Compile Include="Widgets\Logic\MusicPlayerLogic.cs" /> <Compile Include="Widgets\Logic\MusicPlayerLogic.cs" />
<Compile Include="Widgets\Logic\OrderButtonsChromeLogic.cs" /> <Compile Include="Widgets\Logic\OrderButtonsChromeLogic.cs" />
<Compile Include="Widgets\Logic\PerfDebugLogic.cs" /> <Compile Include="Widgets\Logic\PerfDebugLogic.cs" />
<Compile Include="Widgets\Logic\RAInstallFromCDLogic.cs" /> <Compile Include="Widgets\Logic\RAInstallFromCDLogic.cs" />
<Compile Include="Widgets\Logic\DirectConnectLogic.cs" />
<Compile Include="Widgets\Logic\RAInstallLogic.cs" /> <Compile Include="Widgets\Logic\RAInstallLogic.cs" />
<Compile Include="Widgets\Logic\ReplayBrowserLogic.cs" /> <Compile Include="Widgets\Logic\ReplayBrowserLogic.cs" />
<Compile Include="Widgets\Logic\ServerBrowserLogic.cs" /> <Compile Include="Widgets\Logic\ServerBrowserLogic.cs" />
@@ -359,11 +364,6 @@
<Compile Include="World\ChooseBuildTabOnSelect.cs" /> <Compile Include="World\ChooseBuildTabOnSelect.cs" />
<Compile Include="World\PlayMusicOnMapLoad.cs" /> <Compile Include="World\PlayMusicOnMapLoad.cs" />
<Compile Include="World\SmudgeLayer.cs" /> <Compile Include="World\SmudgeLayer.cs" />
<Compile Include="Widgets\Logic\LobbyUtils.cs" />
<Compile Include="Widgets\Logic\DownloadPackagesLogic.cs" />
<Compile Include="AI\BaseBuilder.cs" />
<Compile Include="AI\HackyAI.cs" />
<Compile Include="Render\RenderInfantryPanic.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj"> <ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">