public TickSystem(HomelandsGame game, TickSettings settings) { _game = game; _tickNumber = 0; _turnNumber = 0; _lastTurnTime = Time.time; }
public static GameSettings Make(GameConfigs configs) { eGame gameType = configs._gameType; if (gameType == eGame.Sandbox) { return(new GameSettings(configs)); } else if (gameType == eGame.Exodus) { return(new GameSettings(eGame.Exodus, eEndCondition.Survival, new MapSettings(configs._mapConfigs), PlayerSettings.ExodusSettings(), TickSettings.ExodusSettings())); } else if (gameType == eGame.HotSeat) { return(new GameSettings(eGame.HotSeat, eEndCondition.LastOneStanding, MapSettings.HotseatSettings(), new PlayerSettings(configs._playerConfigs), TickSettings.HotseatSettings())); } else { throw new System.NotImplementedException(); } }
public GameSettings(GameConfigs configs) { _gameType = configs._gameType; _endCondition = configs._endCondition; _mapSettings = new MapSettings(configs._mapConfigs); _playerSettings = new PlayerSettings(configs._playerConfigs); _tickSettings = new TickSettings(configs._tickConfigs); }
public GameSettings(eGame gameType, eEndCondition endCondition, MapSettings map, PlayerSettings player, TickSettings tick) { _gameType = gameType; _endCondition = endCondition; _mapSettings = map; _playerSettings = player; _tickSettings = tick; }
public static TickSystem Make(HomelandsGame game, TickSettings settings) { eTickSystem type = settings._type; if (type == eTickSystem.TurnBased) { return new TickSysTurnBased(game, settings); } else if (type == eTickSystem.SemiRealTime) { return new TickSysRealTime(game, settings); } else { throw new System.NotImplementedException(); } }
SfCircularGauge getCircularGauge() { if (this.ContentView == null) { circularGauge = new SfCircularGauge(); ObservableCollection<Scale> scales = new ObservableCollection<Scale>(); circularGauge.VerticalOptions = LayoutOptions.CenterAndExpand; //Scales scale = new Scale(); scale.StartValue = 0; scale.EndValue = 100; scale.Interval = 10; scale.StartAngle = 135; scale.SweepAngle = 270; scale.RimThickness = 20; scale.RimColor = Color.FromHex("#d14646"); scale.LabelColor = Color.Gray; scale.LabelOffset = 0.1; scale.MinorTicksPerInterval = 0; List<Pointer> pointers = new List<Pointer>(); needlePointer = new NeedlePointer(); needlePointer.Value = 60; needlePointer.Color = Color.Gray; needlePointer.KnobRadius = 20; needlePointer.KnobColor = Color.FromHex("#2bbfb8"); needlePointer.Thickness = 5; needlePointer.LengthFactor = 0.8; needlePointer.Type = PointerType.Bar; rangePointer = new RangePointer(); rangePointer.Value = 60; rangePointer.Color = Color.FromHex("#2bbfb8"); rangePointer.Thickness = 20; pointers.Add(needlePointer); pointers.Add(rangePointer); TickSettings minor = new TickSettings(); minor.Length = 4; minor.Color = Color.FromHex("#444444"); minor.Thickness = 3; scale.MinorTickSettings = minor; major = new TickSettings(); major.Length = 12; major.Color = Color.FromHex("#444444"); major.Thickness = 3; major.Offset = Device.OnPlatform(0.05, 0.1,0.3); scale.MajorTickSettings = major; scale.Pointers = pointers; scales.Add(scale); circularGauge.Scales = scales; Header header = new Header(); header.Text = "Speedmeter"; header.TextSize = 20; header.Position = Device.OnPlatform(iOS: new Point(.3, .7), Android: new Point(0.38, 0.7), WinPhone: new Point(0.38, 0.7)); header.ForegroundColor = Color.Gray; circularGauge.Headers.Add(header); } return circularGauge; }
public TickSysTurnBased(HomelandsGame game, TickSettings settings) : base(game, settings) { }
internal void Initialize(HomelandsGame game, TickSettings tickSettings) { _game = game; }
SfCircularGauge getCircularGauge() { if (this.ContentView == null) { circularGauge = new SfCircularGauge(); ObservableCollection <Scale> scales = new ObservableCollection <Scale>(); circularGauge.VerticalOptions = LayoutOptions.CenterAndExpand; //Scales scale = new Scale(); scale.StartValue = 0; scale.EndValue = 100; scale.Interval = 10; scale.StartAngle = 135; scale.SweepAngle = 270; scale.RimThickness = 20; scale.RimColor = Color.FromHex("#d14646"); scale.LabelColor = Color.Gray; scale.LabelOffset = 0.1; scale.MinorTicksPerInterval = 0; List <Pointer> pointers = new List <Pointer>(); needlePointer = new NeedlePointer(); needlePointer.Value = 60; needlePointer.Color = Color.Gray; needlePointer.KnobRadius = 20; needlePointer.KnobColor = Color.FromHex("#2bbfb8"); needlePointer.Thickness = 5; needlePointer.LengthFactor = 0.8; needlePointer.Type = PointerType.Bar; rangePointer = new RangePointer(); rangePointer.Value = 60; rangePointer.Color = Color.FromHex("#2bbfb8"); rangePointer.Thickness = 20; pointers.Add(needlePointer); pointers.Add(rangePointer); TickSettings minor = new TickSettings(); minor.Length = 4; minor.Color = Color.FromHex("#444444"); minor.Thickness = 3; scale.MinorTickSettings = minor; major = new TickSettings(); major.Length = 12; major.Color = Color.FromHex("#444444"); major.Thickness = 3; major.Offset = Device.OnPlatform(0.05, 0.1, 0.3); scale.MajorTickSettings = major; scale.Pointers = pointers; scales.Add(scale); circularGauge.Scales = scales; Header header = new Header(); header.Text = "Speedmeter"; header.TextSize = 20; header.Position = Device.OnPlatform(iOS: new Point(.3, .7), Android: new Point(0.38, 0.7), WinPhone: new Point(0.38, 0.7)); header.ForegroundColor = Color.Gray; circularGauge.Headers.Add(header); } return(circularGauge); }
public TickSysRealTime(HomelandsGame game, TickSettings settings) : base(game, settings) { _secondsPerTurn = settings._secondsPerTurn; }