public void Launch(EngineSettings settings) { Console.WriteLine ("====================="); Console.WriteLine ("Launching Game Engine"); Console.WriteLine ("====================="); // TODO: Should this be dependent on "verbose" flag? //Console.WriteDebugLine ("Engine ID: " + engineId); var context = EngineContext.New (settings); context.Settings.OutputType = ConsoleOutputType.Game; context.PopulateFromSettings (); context.AddCompleteLogic (); context.Initialize (); //EngineProcess engine = null; // TODO: Remove if not needed try { using(var engine = new EngineProcess (context)) { engine.Run(); } } catch (GameException ex) { context.Console.WriteDebugLine (ex.Message); } //finally { // if (engine != null) // engine.Dispose (); }
public BuildShelterActivity(Person actor, NeedEntry needEntry, EngineSettings settings, ConsoleHelper console) : base(actor, needEntry, settings, console) { // TODO //WoodFelling = new FellWoodActivity (); //TimberMilling = new MillTimberActivity (); }
public Inventory(IHasInventory parent, EngineSettings settings) { Settings = settings; Parent = parent; Construct (); }
public Inventory(IHasInventory parent, DemandList demands, EngineSettings settings) { Parent = parent; Settings = settings; Demands = demands; Construct (); }
public Person(EngineSettings settings) { Demands = new DemandList (this); Inventory = new Inventory (this, Demands, settings); Vitals.Add (PersonVitalType.Energy, 100); Vitals.Add (PersonVitalType.Health, 100); Vitals.Add (PersonVitalType.Thirst, 0); Vitals.Add (PersonVitalType.Hunger, 0); }
public BaseActivity(Person actor, NeedEntry needEntry, EngineSettings settings, ConsoleHelper console) { Actor = actor; NeedEntry = needEntry; Settings = settings; Console = console; InitializeItemsProduced (); InitializeItemsConsumed (); }
// TODO: Remove if not needed /*public EngineClock (DateTime startTime, EngineContext context) { throw new NotImplementedException (); //Context = context; //StartTime = startTime; }*/ public EngineClock(EngineSettings settings, ConsoleHelper console) { Console = console; if (settings.IsVerbose) Console.WriteDebugLine ("Constructing game engine clock"); Settings = settings; StartTime = DateTime.Now; if (settings.IsVerbose) Console.WriteDebugLine ("Setting start time to: " + StartTime.ToString()); }
public BaseNeedIdentifier(ActivityVerb actionType, ItemType itemType, PersonVitalType vitalType, EngineSettings settings, ConsoleHelper console) { ActionType = actionType; ItemType = itemType; VitalType = vitalType; Settings = settings; Console = console; if (vitalType != PersonVitalType.NotSet) DefaultPriority = settings.DefaultVitalPriorities [vitalType]; else if (itemType != ItemType.NotSet) DefaultPriority = settings.DefaultItemPriorities [itemType]; }
public EngineContext(EngineSettings settings, DataManager data) { Data = data; Settings = settings; Console = new ConsoleHelper (Settings); Clock = new EngineClock (Settings, Console); Info = new EngineInfo (Clock.StartTime, Settings); Log = new LogWriter (Settings.EngineId, data.Client); World = new GameEnvironment (this); if (Settings.IsVerbose) Console.WriteDebugLine ("Constructing engine context"); }
public static EngineSettings GetSettings(string[] args) { var arguments = new Arguments (args); var settings = new EngineSettings (); settings.EngineId = GetEngineId (arguments); if (arguments.ContainsAny ("v", "verbose")) settings.OutputType = tilesim.Engine.ConsoleOutputType.Debug; if (arguments.ContainsAny ("speed")) settings.GameSpeed = arguments.GetInt("speed"); if (settings.IsVerbose) { // TODO: Output settings summary } return settings; }
public PersonEnergyEffect(EngineSettings settings, ConsoleHelper console) : base(settings, console) { }
public GatherFoodActivity(Person actor, NeedEntry needEntry, EngineSettings settings, ConsoleHelper console) : base(actor, needEntry, settings, console) { }
public ConsoleHelper(EngineSettings settings) { Settings = settings; }
public MockGameCreator(EngineSettings settings) { Settings = settings; }
public StarvationEffect(EngineSettings settings, ConsoleHelper console) : base(settings, console) { }
public BuildShelterNeedIdentifier(EngineSettings settings, ConsoleHelper console) : base(ActivityVerb.Build, ItemType.Shelter, PersonVitalType.NotSet, settings, console) { }
public ThirstEffect(EngineSettings settings, ConsoleHelper console) : base(settings, console) { }
public static EngineContext New(EngineSettings settings) { return new GameCreator (settings).Create (); }
public PersonCreator(EngineSettings settings) { Settings = settings; }
public ShelterDecision(EngineSettings settings) : base(settings) { }
public BaseEffect(EngineSettings settings, ConsoleHelper console) { Settings = settings; Console = console; }
public Building(EngineSettings settings) { Construct (settings); }
public Building(BuildingType type, EngineSettings settings) { Construct (settings); Type = type; }
public void Construct(EngineSettings settings) { People = new Person[]{ }; Inventory = new Inventory (this, settings); Settings = settings; }
public FightActivity(Person person, NeedEntry needEntry, EngineSettings settings, ConsoleHelper console) : base(person, needEntry, settings, console) { }
public MockEngineContext(EngineSettings settings, DataManager data) : base(settings, data) { }
public HungerEffect(EngineSettings settings, ConsoleHelper console) : base(settings, console) { }
// TODO: Clean up // public BaseDecision (EngineContext context) public BaseDecision(EngineSettings settings) { Settings = settings; }
public PlayerDeathEffect(EngineSettings settings, ConsoleHelper console) : base(settings, console) { }
public CollectWaterActivity(Person actor, NeedEntry needEntry, EngineSettings settings, ConsoleHelper console) : base(actor, needEntry, settings, console) { }