This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Sprite | |
| { | |
| private Color tint; // this is a normal field. its private, so only we can see it. | |
| // THIS IS BAD DONT DO IT :) public Color tint; // this is a public field. Any other class can see it, this is what you would do in java. in C# this is bad code! | |
| // this is a property, and the way you should expose data to other classes. Use it to wrap a varible up. this means if later you decided you want to let tint be shades of red, you just change the set method to enforce that new rule. you dont have to go though allll the code that sets tint and change that to enfore a new data rule. | |
| public Color Tint | |
| { | |
| get { return tint;} | |
| set { tint= value;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PatrolBehavior : LoopNode | |
| { | |
| private int minimumPatrolTime = 4; | |
| private int patrolTimeModifier = 8; | |
| public PatrolBehavior() | |
| { | |
| // The Patrol Behavior has two major parts, a timer/skillcheck to decide how long it runs for and movement/flip branch. | |
| Parallel | |
| ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SatsManger | |
| { | |
| private Dictionary<string, BaseSwindleStat> allStats = new Dictionary<string, BaseSwindleStat>(); // a collection of all the stats that we could unlock | |
| private Dictionary<string, BaseSwindleStat> unlockedStats = new Dictionary<string, BaseSwindleStat>(); // a collection of stats we have unlocekd. | |
| public bool HasUnlockedStat(string statName) | |
| { | |
| return unlockedStats.ContainsKey(statName); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| System.Version MyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; | |
| // MyVersion.Build = days after 2000-01-01 | |
| // MyVersion.Revision*2 = seconds after 0-hour (NEVER daylight saving time) | |
| DateTime MyTime = new DateTime(2000, 1, 1).AddDays(MyVersion.Build).AddSeconds(MyVersion.Revision * 2); | |
| return string.Format("Version:{0} Compiled:{1:s}", MyVersion, MyTime); |
NewerOlder