diff --git a/PingPong.GameEngine/AssemblyInfo.cs b/PingPong.GameEngine/AssemblyInfo.cs new file mode 100644 index 0000000..dda9a69 --- /dev/null +++ b/PingPong.GameEngine/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("PingPong.GameEngine")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("wagesj45")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/PingPong.GameEngine/Components/IScorable.cs b/PingPong.GameEngine/Components/IScorable.cs new file mode 100644 index 0000000..25dd4aa --- /dev/null +++ b/PingPong.GameEngine/Components/IScorable.cs @@ -0,0 +1,26 @@ +using System; +namespace PingPong.GameEngine.Components +{ + public interface IScorable + { + /// + /// Gets the score. + /// + /// + /// The score. + /// + Score Score { get; } + + /// + /// Sets the score. + /// + /// + /// The score. + /// + /// + /// Score. + /// + T SetScore(Score score); + } +} + diff --git a/PingPong.GameEngine/Components/Player.cs b/PingPong.GameEngine/Components/Player.cs new file mode 100644 index 0000000..2ec5974 --- /dev/null +++ b/PingPong.GameEngine/Components/Player.cs @@ -0,0 +1,109 @@ +using System; +namespace PingPong.GameEngine.Components +{ + public class Player : IScorable + { + #region Members + + /// + /// The name. + /// + private Lazy name; + /// + /// The score. + /// + private Lazy score; + + #endregion + + + #region Properties + + /// + /// Gets the name. + /// + /// + /// The name. + /// + public string Name + { + get + { + return this.name.Value; + } + } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public Player() + { + this.name = new Lazy(() => string.Empty); + this.score = new Lazy(() => new Score()); + } + + #endregion + + #region Methods + + /// + /// Sets the name. + /// + /// + /// The name. + /// + /// + /// Name. + /// + public Player SetName(string name) + { + this.name = new Lazy(() => name); + return this; + } + + #endregion + + #region Implementation of IScorable + + /// + /// Gets the score. + /// + /// + /// The score. + /// + public Score Score + { + get + { + return this.score.Value; + } + } + + /// + /// Sets the score. + /// + /// + /// The score. + /// + /// + /// Score. + /// + public Player SetScore(Score score) + { + if (score == null) + { + throw new ArgumentNullException("score"); + } + + this.score = new Lazy(() => score); + return this; + } + + #endregion + } +} + diff --git a/PingPong.GameEngine/Components/Score.cs b/PingPong.GameEngine/Components/Score.cs new file mode 100644 index 0000000..1b3dbe7 --- /dev/null +++ b/PingPong.GameEngine/Components/Score.cs @@ -0,0 +1,211 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace PingPong.GameEngine.Components +{ + public class Score + { + #region Members + + /// + /// The score history. + /// + private Stack history; + + /// + /// The score value. + /// + private Lazy value; + + #endregion + + #region Properties + + /// + /// Gets the score value. + /// + /// + /// The value. + /// + public int Value + { + get + { + return this.value.Value; + } + private set + { + history.Push(this.Value); + this.value = new Lazy(() => value); + } + } + + /// + /// Gets the increment expression. + /// + /// + /// The increment expression. + /// + public string IncrementExpression { get; private set; } + + /// + /// Gets the decrement expression. + /// + /// + /// The decrement expression. + /// + public string DecrementExpression { get; private set; } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public Score() + { + this.history = new Stack(); + this.value = new Lazy(() => default(int)); + } + + #endregion + + #region Methods + + /// + /// Sets the increment expression. + /// + /// + /// The increment expression. + /// + /// + /// Expression. + /// + public Score SetIncrementExpression(string expression) + { + if (string.IsNullOrWhiteSpace(expression)) + { + throw new ArgumentNullException("expression"); + } + + this.IncrementExpression = expression; + return this; + } + + /// + /// Sets the decrement expression. + /// + /// + /// The decrement expression. + /// + /// + /// Expression. + /// + public Score SetDecrementExpression(string expression) + { + this.DecrementExpression = expression; + return this; + } + + /// + /// Sets the score. + /// + /// + /// The score. + /// + /// + /// Expression. + /// + public Score SetScore(string expression) + { + if (string.IsNullOrWhiteSpace(expression)) + { + throw new ArgumentNullException("expression"); + } + + Engine.ExpressionParser.Interpret(expression); + this.Value = Engine.ExpressionParser.Int; + return this; + } + + /// + /// Sets the score. + /// + /// + /// The score. + /// + /// + /// Score. + /// + public Score SetScore(int score) + { + this.Value = score; + return this; + } + + /// + /// Increment this instance. + /// + public int Increment() + { + if (string.IsNullOrWhiteSpace(this.IncrementExpression)) + { + throw new NotImplementedException("No increment expression set."); + } + + Engine.ExpressionParser.Interpret(this.IncrementExpression); + this.Value += Engine.ExpressionParser.Int; + return this.Value; + } + + /// + /// Decrement this instance. + /// + public int Decrement() + { + if (string.IsNullOrWhiteSpace(this.DecrementExpression)) + { + Reverse(); + } + else + { + throw new NotImplementedException("No decrement expression set."); + } + + Engine.ExpressionParser.Interpret(this.DecrementExpression); + this.Value += Engine.ExpressionParser.Int; + return this.Value; + } + + /// + /// Reverse the last action. + /// + public int Reverse() + { + if (!this.history.Any()) + { + throw new ArgumentOutOfRangeException("No history found."); + } + + this.value = new Lazy(() => this.history.Pop()); + return this.Value; + } + + #endregion + + #region Operators + + /// + /// Score. + /// + public static implicit operator int(Score score) + { + return score.Value; + } + + #endregion + } +} + diff --git a/PingPong.GameEngine/Components/ScoringType.cs b/PingPong.GameEngine/Components/ScoringType.cs new file mode 100644 index 0000000..4187d73 --- /dev/null +++ b/PingPong.GameEngine/Components/ScoringType.cs @@ -0,0 +1,12 @@ +using System; +namespace PingPong.GameEngine.Components +{ + + public enum ScoringType + { + None, + Team, + Individual + } +} + diff --git a/PingPong.GameEngine/Components/Team.cs b/PingPong.GameEngine/Components/Team.cs new file mode 100644 index 0000000..d28dcec --- /dev/null +++ b/PingPong.GameEngine/Components/Team.cs @@ -0,0 +1,410 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace PingPong.GameEngine.Components +{ + + public class Team : IList, IScorable + { + #region Members + + /// + /// The collection. + /// + private Lazy> collection; + /// + /// The score. + /// + private Lazy score; + /// + /// The type of the team rotation. + /// + private Lazy teamRotationType; + + #endregion + + #region Properties + + /// + /// Gets the Collection. + /// + /// + /// The collection. + /// + private List Collection + { + get + { + return this.collection.Value; + } + } + + /// + /// Gets the type of the team rotation. + /// + /// + /// The type of the team rotation. + /// + public TeamRotationType TeamRotationType + { + get + { + return this.teamRotationType.Value; + } + } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public Team() + { + this.collection = new Lazy>(() => new List()); + this.score = new Lazy(() => new Score()); + } + + #endregion + + #region Methods + + /// + /// Gets the player. + /// + /// + /// The player. + /// + /// + /// Name. + /// + public Player GetPlayer(string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new ArgumentNullException("name"); + } + + return this.Where(player => player.Name.Equals( + name, + StringComparison.OrdinalIgnoreCase + ) + ) + .FirstOrDefault(); + } + + /// + /// Sets the type of the team rotation. + /// + /// + /// The team rotation type. + /// + /// + /// Team rotation type. + /// + public Team SetTeamRotationType(TeamRotationType teamRotationType) + { + this.teamRotationType = new Lazy(() => teamRotationType); + return this; + } + + /// + /// Rotates the team. + /// + /// + /// The team. + /// + public Team RotateTeam() + { + switch (this.TeamRotationType) + { + case TeamRotationType.RoundRobin: + PerformRoundRobinRotation(); + break; + case TeamRotationType.Random: + PerformRandomRotation(); + break; + case TeamRotationType.None: + default: + break; + } + + return this; + } + + /// + /// Performs the round robin rotation. + /// + private void PerformRoundRobinRotation() + { + if (this.Collection.Any()) + { + var player = this.Collection.LastOrDefault(); + var lastIndex = this.Collection.Count - 1; + this.Collection.RemoveAt(lastIndex); + + this.Collection.Insert(0,player); + } + + } + + /// + /// Performs the random rotation. + /// + private void PerformRandomRotation() + { + if (this.Collection.Any()) + { + this.collection = new Lazy>(() => this.Collection.Select(player => new { GUID = new Guid(), Player = player }) + .OrderBy(anon => anon.GUID) + .Select(anon => anon.Player) + .ToList() + ); + } + } + + #endregion + + #region IEnumerable implementation + + /// + /// Gets the enumerator. + /// + /// + /// The enumerator. + /// + public System.Collections.IEnumerator GetEnumerator() + { + return this.Collection.GetEnumerator(); + } + + #endregion + + #region IEnumerable implementation + + /// + /// Gets the enumerator. + /// + /// + /// The enumerator. + /// + IEnumerator IEnumerable.GetEnumerator() + { + return this.Collection.GetEnumerator(); + } + + #endregion + + #region ICollection implementation + + /// + /// The item to add to the current collection. + /// + /// + /// Adds an item to the current collection. + /// + /// + /// To be added. + /// + /// + /// The current collection is read-only. + /// + /// + /// Add the specified item. + /// + /// + /// Item. + /// + public void Add(Player item) + { + this.Collection.Add(item); + } + + /// + /// Clear this instance. + /// + public void Clear() + { + this.Collection.Clear(); + } + + /// + /// The object to locate in the current collection. + /// + /// + /// Determines whether the current collection contains a specific value. + /// + /// + /// Contains the specified item. + /// + /// + /// If set to true item. + /// + public bool Contains(Player item) + { + return this.Collection.Contains(item); + } + + /// + /// Copies to. + /// + /// + /// Array. + /// + /// + /// Array index. + /// + public void CopyTo(Player[] array, int arrayIndex) + { + this.Collection.CopyTo(array,arrayIndex); + } + + /// + /// The item to remove from the current collection. + /// + /// + /// Removes the first occurrence of an item from the current collection. + /// + /// + /// Remove the specified item. + /// + /// + /// If set to true item. + /// + public bool Remove(Player item) + { + return this.Collection.Remove(item); + } + + /// + /// Gets the count. + /// + /// + /// The count. + /// + public int Count + { + get + { + return this.Collection.Count; + } + } + + /// + /// Gets a value indicating whether this instance is read only. + /// + /// + /// true if this instance is read only; otherwise, false. + /// + public bool IsReadOnly + { + get + { + return false; + } + } + #endregion + + #region IScorable implementation + + /// + /// Gets the score. + /// + /// + /// The score. + /// + public Score Score + { + get + { + return this.score.Value; + } + } + + /// + /// Sets the score. + /// + /// + /// The score. + /// + /// + /// Score. + /// + public Team SetScore(Score score) + { + this.score = new Lazy(() => score); + return this; + } + #endregion + + #region IList implementation + + /// + /// To be added. + /// + /// + /// Determines the index of a specific item in the current instance. + /// + /// + /// Indexs the of. + /// + /// + /// The of. + /// + /// + /// Item. + /// + public int IndexOf(Player item) + { + return this.Collection.IndexOf(item); + } + + /// + /// Insert the specified index and item. + /// + /// + /// Index. + /// + /// + /// Item. + /// + public void Insert(int index, Player item) + { + this.Collection.Insert(index,item); + } + + /// + /// Removes at index. + /// + /// + /// Index. + /// + public void RemoveAt(int index) + { + this.RemoveAt(index); + } + + /// + /// Gets or sets the at the specified index. + /// + /// + /// Index. + /// + public Player this [int index] + { + get + { + return this.Collection[index]; + } + set + { + this.Collection[index] = value; + } + } + + #endregion + } +} + diff --git a/PingPong.GameEngine/Components/TeamRotationType.cs b/PingPong.GameEngine/Components/TeamRotationType.cs new file mode 100644 index 0000000..01484ca --- /dev/null +++ b/PingPong.GameEngine/Components/TeamRotationType.cs @@ -0,0 +1,21 @@ +using System; +namespace PingPong.GameEngine.Components +{ + + public enum TeamRotationType + { + /// + /// No rotation. + /// + None, + /// + /// Round robin progression. + /// + RoundRobin, + /// + /// Random reordering. + /// + Random + } +} + diff --git a/PingPong.GameEngine/Components/desktop.ini b/PingPong.GameEngine/Components/desktop.ini new file mode 100644 index 0000000..dce88a3 --- /dev/null +++ b/PingPong.GameEngine/Components/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/PingPong.GameEngine/Engine.cs b/PingPong.GameEngine/Engine.cs new file mode 100644 index 0000000..b512450 --- /dev/null +++ b/PingPong.GameEngine/Engine.cs @@ -0,0 +1,43 @@ +using System; +using csmic; +using PingPong.Generic; + +namespace PingPong.GameEngine +{ + public class Engine + { + /// + /// The input interpreter. + /// + private static Locked> inputInterpreter; + + #region Properties + + /// + /// Gets the expression parser. + /// + /// + /// The expression parser. + /// + public static InputInterpreter ExpressionParser + { + get + { + return inputInterpreter.Value.Value; + } + } + + #endregion + + public Engine() + { + // + } + + static Engine() + { + inputInterpreter = new Locked>(new Lazy(() => new InputInterpreter())); + } + } +} + diff --git a/PingPong.GameEngine/GameCondition.cs b/PingPong.GameEngine/GameCondition.cs new file mode 100644 index 0000000..ffb6494 --- /dev/null +++ b/PingPong.GameEngine/GameCondition.cs @@ -0,0 +1,78 @@ +using System; +namespace PingPong.GameEngine +{ + + public class GameCondition + { + #region Members + + /// + /// The expression. + /// + private Lazy expression; + + #endregion + + #region Properties + + /// + /// Gets the expression. + /// + /// + /// The expression. + /// + public string Expression + { + get + { + return this.expression.Value; + } + } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public GameCondition() + { + this.expression = new Lazy(() => string.Empty); + } + + #endregion + + #region Methods + + /// + /// Evaluate this instance. + /// + public bool Evaluate() + { + Engine.ExpressionParser.Interpret(this.Expression); + return Engine.ExpressionParser.Output.Equals( + bool.TrueString, + StringComparison.OrdinalIgnoreCase + ); + } + + /// + /// Sets the expression. + /// + /// + /// The expression. + /// + /// + /// Expression. + /// + public GameCondition SetExpression(string expression) + { + this.expression = new Lazy(() => expression); + return this; + } + + #endregion + } +} + diff --git a/PingPong.GameEngine/GameDefinition.cs b/PingPong.GameEngine/GameDefinition.cs new file mode 100644 index 0000000..14bb3bb --- /dev/null +++ b/PingPong.GameEngine/GameDefinition.cs @@ -0,0 +1,22 @@ +using System; +namespace PingPong.GameEngine +{ + public class GameDefinition + { + public GameDefinition () + { + #region Members + + + + #endregion + + #region Properties + + + + #endregion + } + } +} + diff --git a/PingPong.GameEngine/GameState.cs b/PingPong.GameEngine/GameState.cs new file mode 100644 index 0000000..50c4e5a --- /dev/null +++ b/PingPong.GameEngine/GameState.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using PingPong.GameEngine.Components; + +namespace PingPong.GameEngine +{ + public class GameState + { + #region Members + + /// + /// The teams. + /// + private Lazy> teams; + /// + /// The type of the scoring. + /// + private Lazy scoringType; + + #endregion + + #region Properties + + /// + /// Gets the teams. + /// + /// + /// The teams. + /// + private List TeamList + { + get + { + return this.teams.Value; + } + } + + /// + /// Gets the teams. + /// + /// + /// The teams. + /// + public IEnumerable Teams + { + get + { + return this.TeamList; + } + } + + /// + /// Gets the type of the scoring. + /// + /// + /// The type of the scoring. + /// + public ScoringType ScoringType + { + get + { + return this.scoringType.Value; + } + } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public GameState() + { + this.teams = new Lazy>(() => new List()); + this.scoringType = new Lazy(() => ScoringType.None); + } + + #endregion + + #region Methods + + /// + /// Initialize the specified gameDefinition. + /// + /// + /// Game definition. + /// + public GameState Initialize(GameDefinition gameDefinition) + { + if (gameDefinition == null) + { + throw new ArgumentNullException("gameDefinition"); + } + + //TODO: Add loading logic here. + + + return this; + } + + /// + /// Adds the team. + /// + /// + /// The team. + /// + /// + /// Team. + /// + public GameState AddTeam(Team team) + { + if(team == null) + { + throw new ArgumentNullException("team"); + } + + this.TeamList.Add(team); + return this; + } + + /// + /// Removes the team. + /// + /// + /// The team. + /// + /// + /// Team. + /// + public GameState RemoveTeam(Team team) + { + if (team == null) + { + throw new ArgumentNullException("team"); + } + + this.TeamList.Remove(team); + } + + #endregion + } +} + diff --git a/PingPong.GameEngine/PingPong.GameEngine.csproj b/PingPong.GameEngine/PingPong.GameEngine.csproj new file mode 100644 index 0000000..f108bf4 --- /dev/null +++ b/PingPong.GameEngine/PingPong.GameEngine.csproj @@ -0,0 +1,65 @@ + + + + Debug + AnyCPU + 10.0.0 + 2.0 + {9C0A0C83-B112-4959-BD94-D6A22AD5AC90} + Library + PingPong.GameEngine + PingPong.GameEngine + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + none + true + bin\Release + prompt + 4 + false + + + + + ..\packages\csmic.1.1.3\lib\csmic.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + {630BDE02-B1C2-4D9F-8BFB-4FCAF128BE14} + PingPong.Generic + + + \ No newline at end of file diff --git a/PingPong.GameEngine/csmic_help.chm b/PingPong.GameEngine/csmic_help.chm new file mode 100644 index 0000000..b47106d Binary files /dev/null and b/PingPong.GameEngine/csmic_help.chm differ diff --git a/PingPong.GameEngine/desktop.ini b/PingPong.GameEngine/desktop.ini new file mode 100644 index 0000000..dce88a3 --- /dev/null +++ b/PingPong.GameEngine/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/PingPong.GameEngine/packages.config b/PingPong.GameEngine/packages.config new file mode 100644 index 0000000..7b5cb7e --- /dev/null +++ b/PingPong.GameEngine/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/PingPong.Generic/AssemblyInfo.cs b/PingPong.Generic/AssemblyInfo.cs new file mode 100644 index 0000000..2283ae2 --- /dev/null +++ b/PingPong.Generic/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("PingPong.Generic")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("wagesj45")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/PingPong.Generic/Locked.cs b/PingPong.Generic/Locked.cs new file mode 100644 index 0000000..f350a32 --- /dev/null +++ b/PingPong.Generic/Locked.cs @@ -0,0 +1,89 @@ +using System; +namespace PingPong.Generic +{ + + public class Locked + { + #region Members + + /// + /// The lock object. + /// + private object lockObject; + /// + /// The value. + /// + private T value; + /// + /// The is locked. + /// + private bool isLocked; + + #endregion + + #region Properties + + /// + /// Gets or sets the value. + /// + /// + /// The value. + /// + public T Value + { + get + { + return this.value; + } + set + { + lock (this.lockObject) + { + this.isLocked = true; + this.value = value; + this.isLocked = false; + } + } + } + + /// + /// Gets a value indicating whether this instance is locked. + /// + /// + /// true if this instance is locked; otherwise, false. + /// + public bool IsLocked + { + get + { + return this.isLocked; + } + } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public Locked() + { + this.value = default(T); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// Value. + /// + public Locked(T value) + { + this.value = value; + } + + #endregion + } +} + diff --git a/PingPong.Generic/PingPong.Generic.csproj b/PingPong.Generic/PingPong.Generic.csproj new file mode 100644 index 0000000..5d620ad --- /dev/null +++ b/PingPong.Generic/PingPong.Generic.csproj @@ -0,0 +1,39 @@ + + + + Debug + AnyCPU + 10.0.0 + 2.0 + {630BDE02-B1C2-4D9F-8BFB-4FCAF128BE14} + Library + PingPong.Generic + PingPong.Generic + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + none + true + bin\Release + prompt + 4 + false + + + + + + + + + + \ No newline at end of file diff --git a/PingPong.Generic/desktop.ini b/PingPong.Generic/desktop.ini new file mode 100644 index 0000000..dce88a3 --- /dev/null +++ b/PingPong.Generic/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/PingPong/AssemblyInfo.cs b/PingPong/AssemblyInfo.cs new file mode 100644 index 0000000..71b9e7b --- /dev/null +++ b/PingPong/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("PingPong")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("wagesj45")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/PingPong/Main.cs b/PingPong/Main.cs new file mode 100644 index 0000000..6e5680c --- /dev/null +++ b/PingPong/Main.cs @@ -0,0 +1,16 @@ +using System; +using Gtk; + +namespace PingPong +{ + class MainClass + { + public static void Main (string[] args) + { + Application.Init (); + MainWindow win = new MainWindow (); + win.Show (); + Application.Run (); + } + } +} diff --git a/PingPong/MainWindow.cs b/PingPong/MainWindow.cs new file mode 100644 index 0000000..b450b52 --- /dev/null +++ b/PingPong/MainWindow.cs @@ -0,0 +1,16 @@ +using System; +using Gtk; + +public partial class MainWindow: Gtk.Window +{ + public MainWindow (): base (Gtk.WindowType.Toplevel) + { + Build (); + } + + protected void OnDeleteEvent (object sender, DeleteEventArgs a) + { + Application.Quit (); + a.RetVal = true; + } +} diff --git a/PingPong/PingPong.csproj b/PingPong/PingPong.csproj new file mode 100644 index 0000000..81362a5 --- /dev/null +++ b/PingPong/PingPong.csproj @@ -0,0 +1,68 @@ + + + + Debug + x86 + 10.0.0 + 2.0 + {D5DF4388-106F-40F7-B54C-72E71376AB43} + WinExe + PingPong + PingPong + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + x86 + false + + + none + true + bin\Release + prompt + 4 + x86 + false + + + + + + gtk-sharp-2.0 + + + gdk-sharp-2.0 + + + glib-sharp-2.0 + + + glade-sharp-2.0 + + + pango-sharp-2.0 + + + atk-sharp-2.0 + + + + + gui.stetic + + + + + + + + + + + \ No newline at end of file diff --git a/PingPong/desktop.ini b/PingPong/desktop.ini new file mode 100644 index 0000000..dce88a3 --- /dev/null +++ b/PingPong/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/PingPong/gtk-gui/MainWindow.cs b/PingPong/gtk-gui/MainWindow.cs new file mode 100644 index 0000000..c7e17b2 --- /dev/null +++ b/PingPong/gtk-gui/MainWindow.cs @@ -0,0 +1,38 @@ + +// This file has been generated by the GUI designer. Do not modify. + +public partial class MainWindow +{ + private global::Gtk.Fixed fixed1; + private global::Gtk.Label lblScore; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget MainWindow + this.Name = "MainWindow"; + this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow"); + this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + // Container child MainWindow.Gtk.Container+ContainerChild + this.fixed1 = new global::Gtk.Fixed (); + this.fixed1.Name = "fixed1"; + this.fixed1.HasWindow = false; + // Container child fixed1.Gtk.Fixed+FixedChild + this.lblScore = new global::Gtk.Label (); + this.lblScore.Name = "lblScore"; + this.lblScore.LabelProp = global::Mono.Unix.Catalog.GetString ("00:00"); + this.lblScore.UseMarkup = true; + this.fixed1.Add (this.lblScore); + global::Gtk.Fixed.FixedChild w1 = ((global::Gtk.Fixed.FixedChild)(this.fixed1 [this.lblScore])); + w1.X = 128; + w1.Y = 65; + this.Add (this.fixed1); + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.DefaultWidth = 400; + this.DefaultHeight = 300; + this.Show (); + this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); + } +} diff --git a/PingPong/gtk-gui/desktop.ini b/PingPong/gtk-gui/desktop.ini new file mode 100644 index 0000000..dce88a3 --- /dev/null +++ b/PingPong/gtk-gui/desktop.ini @@ -0,0 +1,5 @@ +[.ShellClassInfo] +InfoTip=This folder is shared online. +IconFile=C:\Program Files\Google\Drive\googledrivesync.exe +IconIndex=16 + \ No newline at end of file diff --git a/PingPong/gtk-gui/generated.cs b/PingPong/gtk-gui/generated.cs new file mode 100644 index 0000000..9636f6f --- /dev/null +++ b/PingPong/gtk-gui/generated.cs @@ -0,0 +1,29 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace Stetic +{ + internal class Gui + { + private static bool initialized; + + internal static void Initialize (Gtk.Widget iconRenderer) + { + if ((Stetic.Gui.initialized == false)) { + Stetic.Gui.initialized = true; + } + } + } + + internal class ActionGroups + { + public static Gtk.ActionGroup GetActionGroup (System.Type type) + { + return Stetic.ActionGroups.GetActionGroup (type.FullName); + } + + public static Gtk.ActionGroup GetActionGroup (string name) + { + return null; + } + } +} diff --git a/PingPong/gtk-gui/gui.stetic b/PingPong/gtk-gui/gui.stetic new file mode 100644 index 0000000..ff582d4 --- /dev/null +++ b/PingPong/gtk-gui/gui.stetic @@ -0,0 +1,34 @@ + + + + ../../PingPong + 2.12 + + + + + + + + MainWindow + CenterOnParent + + + + + False + + + + 00:00 + True + + + 128 + 65 + + + + + + \ No newline at end of file