Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Witold Ksiazek authored and Witold Ksiazek committed Jan 21, 2020
1 parent 04ece8b commit 9b00b72
Show file tree
Hide file tree
Showing 73 changed files with 23,500 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged />
</Weavers>
54 changes: 54 additions & 0 deletions FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="PropertyChanged" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="InjectOnPropertyNameChanged" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEquality" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEqualityUsingBaseEquals" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseStaticEqualsFromBase" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
Binary file added Images/.DS_Store
Binary file not shown.
Binary file added Images/Characters/characters_atlas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Images/Characters/characters_atlas.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/characters_atlas.png-feda367df5706b359397f122beef8237.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Images/Characters/characters_atlas.png"
dest_files=[ "res://.import/characters_atlas.png-feda367df5706b359397f122beef8237.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
8 changes: 8 additions & 0 deletions Images/Characters/knecht.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]

[ext_resource path="res://Images/Characters/characters_atlas.png" type="Texture" id=1]

[resource]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 32, 40 )
21 changes: 21 additions & 0 deletions Images/Grounds/ground_tile_set.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[gd_resource type="TileSet" load_steps=2 format=2]

[ext_resource path="res://Images/Grounds/ground_tiles.png" type="Texture" id=1]

[resource]
0/name = "ground_tiles.png 0"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( -12, -16 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 192, 48 )
0/tile_mode = 2
0/autotile/icon_coordinate = Vector2( 0, 0 )
0/autotile/tile_size = Vector2( 48, 48 )
0/autotile/spacing = 0
0/autotile/occluder_map = [ ]
0/autotile/navpoly_map = [ ]
0/autotile/z_index_map = [ ]
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shapes = [ ]
0/z_index = 0
Binary file added Images/Grounds/ground_tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Images/Grounds/ground_tiles.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/ground_tiles.png-4d8a6cd1f11a2a09b1a3cb4fab4f01e5.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Images/Grounds/ground_tiles.png"
dest_files=[ "res://.import/ground_tiles.png-4d8a6cd1f11a2a09b1a3cb4fab4f01e5.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added Images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Images/icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/icon.png-5c54608cdf98940b04ad240121483c81.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Images/icon.png"
dest_files=[ "res://.import/icon.png-5c54608cdf98940b04ad240121483c81.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
17 changes: 17 additions & 0 deletions Model/Board.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace TradingCompany.Model {
public class Board : IBoard {
public Board(Field[][] fields) {
Fields = fields;

Rows = fields.Length;
Columns = fields[0].Length;
}

public Field[][] Fields { get; }


public int Rows { get; }

public int Columns { get; }
}
}
29 changes: 29 additions & 0 deletions Model/Commands/Command.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using TradingCompany.Model.Math;

namespace TradingCompany.Model.Commands {
public struct Command : IEquatable<Command> {
public readonly IntVector2 TargetPosition;
public readonly CommandType Type;

public Command(IntVector2 targetPosition,
CommandType type) {
TargetPosition = targetPosition;
Type = type;
}

public bool Equals(Command other) {
return TargetPosition.Equals(other.TargetPosition) && Type == other.Type;
}

public override bool Equals(object obj) {
return obj is Command other && Equals(other);
}

public override int GetHashCode() {
unchecked {
return (TargetPosition.GetHashCode() * 397) ^ (int) Type;
}
}
}
}
6 changes: 6 additions & 0 deletions Model/Commands/CommandType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace TradingCompany.Model.Commands {
public enum CommandType {
Move,
Attack
}
}
14 changes: 14 additions & 0 deletions Model/Field.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using TradingCompany.Model.Grounds;

namespace TradingCompany.Model {
public struct Field {
public readonly int Row, Column;
public readonly Ground Ground;

public Field(int row, int column, Ground ground) {
Row = row;
Column = column;
Ground = ground;
}
}
}
11 changes: 11 additions & 0 deletions Model/Grounds/Ground.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace TradingCompany.Model.Grounds {
public struct Ground {
public GroundType GroundType;
public bool IsAccessible;

public Ground(GroundType groundType, bool isAccessible) {
GroundType = groundType;
IsAccessible = isAccessible;
}
}
}
12 changes: 12 additions & 0 deletions Model/Grounds/GroundType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace TradingCompany.Model.Grounds {
/// <summary>
/// View Contract:
/// The order in this enumerable needs to match the order of Tiles in the ground_tile_set.tres
/// </summary>
public enum GroundType {
Water,
Grass,
Forest,
Castle
}
}
5 changes: 5 additions & 0 deletions Model/Grounds/GroundTypeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace TradingCompany.Model.Grounds {
public class GroundTypeConfig {
public bool IsAccessible;
}
}
35 changes: 35 additions & 0 deletions Model/Grounds/GroundTypesFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Collections.Generic;

namespace TradingCompany.Model.Grounds {
public static class GroundTypesFactory {
private static readonly Dictionary<GroundType, GroundTypeConfig> Configs =
new Dictionary<GroundType, GroundTypeConfig> {
{
GroundType.Water,
new GroundTypeConfig {
IsAccessible = false
}
}, {
GroundType.Grass,
new GroundTypeConfig {
IsAccessible = true
}
}, {
GroundType.Forest,
new GroundTypeConfig {
IsAccessible = false
}
}, {
GroundType.Castle,
new GroundTypeConfig {
IsAccessible = true
}
}
};


public static Ground Create(GroundType groundType) {
return new Ground(groundType, Configs[groundType].IsAccessible);
}
}
}
8 changes: 8 additions & 0 deletions Model/IBoard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace TradingCompany.Model {
public interface IBoard {
int Rows { get; }
int Columns { get; }

Field[][] Fields { get; }
}
}
6 changes: 6 additions & 0 deletions Model/IGame.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace TradingCompany.Model {
public interface IGame {
IBoard Board { get; }

}
}
Loading

0 comments on commit 9b00b72

Please sign in to comment.