public void VeryClose() { if (Game.LocalPlayer.Character.Position.DistanceTo(_mainMe) <= 15f) { "At main ME's office".AddLog(); SwapStages(VeryClose, AtLocation); } if (!_main) { _state = ELocation.Done; if (_dialogstate == EDialog.Pre) { _dialogstate = EDialog.During; "Dialog Starting".AddLog(); _driverDialog.StartDialog(); } if (_driverDialog.HasEnded && _dialogstate == EDialog.During) { "Dialog Ending".AddLog(); Game.DisplayHelp("Enter the driver's car"); _dialogstate = EDialog.Post; _playerCar = Game.LocalPlayer.Character.LastVehicle; _me.KeepTasks = true; _me.Tasks.GoStraightToPosition(_meCar.LeftPosition, 3f, 0f, 0f, 1000); GameFiber.Sleep(1000); _me.Tasks.EnterVehicle(_meCar, -1); SwapStages(VeryClose, GettingInCar); } } }
public Element(string tag, List <Data> data, EDistance whichOne = EDistance.First, ELocation where = ELocation.In) { Tag = tag; Data = data; WhichOne = whichOne; Where = where; }
public Element(string tag, Data data, EDistance whichOne = EDistance.First, ELocation where = ELocation.In) { Tag = tag; Data.Add(data); WhichOne = whichOne; Where = where; }
public void AdjustBasedOnELocation(ELocation eLoc) { switch (eLoc) { case ELocation.TopLeft: { _tips.horzGroup.childAlignment = TextAnchor.LowerRight; _tips.rectRoot.pivot = new Vector2(1, 0); } break; case ELocation.TopRight: { _tips.horzGroup.childAlignment = TextAnchor.LowerLeft; _tips.rectRoot.pivot = new Vector2(0, 0); } break; case ELocation.BottomRight: { _tips.horzGroup.childAlignment = TextAnchor.UpperLeft; _tips.rectRoot.pivot = new Vector2(0, 1); } break; case ELocation.BottomLeft: { _tips.horzGroup.childAlignment = TextAnchor.UpperRight; _tips.rectRoot.pivot = new Vector2(1, 1); } break; default: Assert.IsTrue(false, "ATips.AdjustBasedOnELocation: only accept base 4 loc"); break; } }
private (float x, float y) _LocationAutoDetect(Vector3 lastPos, float screenWidth, float screenHeight, Vector2 size) { if (_eRealLoc == ELocation.END) { if (lastPos.x <= screenWidth * 0.5f) { _eRealLoc = lastPos.y <= screenHeight * 0.5f ? ELocation.TopRight : ELocation.BottomRight; } else { _eRealLoc = lastPos.y <= screenHeight * 0.5f ? ELocation.TopLeft : ELocation.BottomLeft; } AdjustBasedOnELocation(_eRealLoc); } float x = 0, y = 0; switch (_eRealLoc) { case ELocation.TopLeft: (x, y) = _DoTopLeft(lastPos, screenWidth, screenHeight, size); break; case ELocation.TopRight: (x, y) = _DoTopRight(lastPos, screenWidth, screenHeight, size); break; case ELocation.BottomRight: (x, y) = _DoBottomRight(lastPos, screenWidth, screenHeight, size); break; case ELocation.BottomLeft: (x, y) = _DoBottomLeft(lastPos, screenWidth, screenHeight, size); break; } return(x, y); }
public JsonResult AddNewLocation(Location location) { try { using (var context = new InventoryDbContext())//Use DbInventory { if (context.Location.Any(l => l.LocationName.ToLower() == location.LocationName.ToLower())) { return(Json("LocationExists")); } else { //Add Location Name ELocation eLocation = new ELocation() { LocationName = location.LocationName, LocationAddress = location.LocationAddress }; context.Location.Add(eLocation); //Insert new location context.SaveChanges(); //Save all changes return(Json(string.Empty)); } } } catch (Exception e) { return(Json(e.ToString())); } }
public Element(string tag, string prop, string value, EDistance whichOne = EDistance.First, ELocation where = ELocation.In) { Tag = tag; Data.Add(new Data(prop, value)); WhichOne = whichOne; Where = where; }
void OnEnable() { if (_eLoc == ELocation.AutoDetect) { _eRealLoc = ELocation.END; } }
public Wall(int x, int y, ELocation _location) { position.X = x; position.Y = y; location = _location; if (location == ELocation.HORIZONTAL) { height = 1; width = 4; } else { width = 1; height = 4; } places = new char[height, width]; SetColors(); for (int i = 0; i < height; ++i) { for (int j = 0; j < width; ++j) { places[i, j] = '#'; colors[i, j] = ConsoleColor.Cyan; } } }
public void EnRoute() { _state = ELocation.Within80; GameFiber.StartNew(delegate { while (true) { _me.Task_Scenario("WORLD_HUMAN_COP_IDLES"); while (NativeFunction.Natives.IS_PED_USING_ANY_SCENARIO <bool>(_me)) { if (_state == ELocation.Within15) { break; } GameFiber.Yield(); } if (_state == ELocation.Within15) { break; } GameFiber.Yield(); } }); DeactivateStage(EnRoute); }
public EventMemento(int guests, EPackageType packageType, ELocation location, EEventDay eventDay, EEventType eventType) { this.Guests = guests; this.PackageType = packageType; this.Location = location; this.EventDay = eventDay; this.EventType = eventType; }
public void Restore(EventMemento eveniment) { this.Guests = eveniment.Guests; this.PackageType = eveniment.PackageType; this.Location = eveniment.Location; this.EventDay = eveniment.EventDay; this.EventType = eveniment.EventType; }
public HealthBar(ELocation location, Color fillerColor) { this.location = location; outLine = new Texture2D(device, 1, 1); outLine.SetData(new[] { Color.Black }); filler = new Texture2D(device, 1, 1); filler.SetData(new[] { fillerColor }); }
public ResortBuilding(ELocation entry, ELocation exit, int dequeueFrequency, string name, Simulator parent) { Entry = entry; Exit = exit; DequeueFrequency = dequeueFrequency; Name = name; EnteredVisitors = new Queue <Visitor>(); this.parent = parent; }
public void Construct(int startPrice, int guests, EPackageType packageType, ELocation location, EEventDay eventDay, EEventType eventType) { eventBuilder.SetStartPrice(startPrice); eventBuilder.SetGuests(guests); eventBuilder.SetPackageType(packageType); eventBuilder.SetLocation(location); eventBuilder.SetEventDay(eventDay); eventBuilder.SetEventType(eventType); }
protected override void Awake() { base.Awake(); _tips = GetComponentInParent <ATips>(); Assert.IsNotNull(_tips); _eRealLoc = ELocation.END; }
private (float x, float y) _LocationTopLeft(Vector3 lastPos, float screenWidth, float screenHeight, Vector2 size) { if (_eRealLoc != ELocation.TopLeft) { _eRealLoc = ELocation.TopLeft; AdjustBasedOnELocation(_eRealLoc); } return(_DoTopLeft(lastPos, screenWidth, screenHeight, size)); }
public Visitor(Simulator parent, bool equipped = false, int arrival = 0, int food = 0, bool rents = false, ESkill skill = ESkill.Blue, int liftrides = 0, int speed = 1) { Equipped = equipped; Rents = rents; Skill = skill; LiftRidesLeft = (Equipped ? liftrides : 0); SpeedFactor = speed; FoodNeed = food; CurrentLocation = ELocation.Downhill; this.parent = parent; parent.RegisterEvent(this, arrival, null); }
public void SetLocation(ELocation eLoc) { if (_eLoc == eLoc) { return; } _eLoc = eLoc; if (gameObject.activeInHierarchy) { Execute(); } }
// public EventBuildOrganizer organizer=new EventBuildOrganizer(builder); //EventBuildOrganizer eventBuildOrganizer = new EventBuildOrganizer(); //public EEventType e = eveniment.EventType; public StandardPackage(EEventType eventType, EEventDay day, ELocation location, int guests) { PType = EPackageType.Standard; EType = eventType; DType = day; LType = location; //EType = builder.SetEventType(); Guests = guests; //eventBuildOrganizer.Construct(eveniment.Guests, eveniment.PackageType,eveniment.Location, eveniment.EventDay, eveniment.EventType); SetPrice(); }
public bool Validate(string document, ELocation location) { switch (location) { case ELocation.PR_BR: return(Validate_PT_BR(document)); case ELocation.EN_US: return(Validate_EN_US(document)); default: return(Validate_EN_US(document)); } }
// todo -- fix all this crap below protected override bool Initialize() { "Initializing L.S. Noir Callout: Sexual Assault -- Stage 2b [Medical Examiner]".AddLog(); _position = GetNearestMe(Game.LocalPlayer.Character.Position); ExtensionMethods.LogDistanceFromCallout(_position); if (GetNearestMe(Game.LocalPlayer.Character.Position) == _blaineMe) { CarSpawn = new Fiskey111Common.SpawnPt(31, 1839, 3666, 34); _meCar = new Vehicle("FBI", CarSpawn.Spawn); _meCar.Heading = CarSpawn.Heading; _me = new Ped("s_m_m_highsec_01", _position, 233f); _main = false; _nearestMe = "SS"; "Closest to Sandy Shores Location".AddLog(); } if (GetNearestMe(Game.LocalPlayer.Character.Position) == _paletoMe) { CarSpawn = new Fiskey111Common.SpawnPt(313, -453, 6034, 31); _meCar = new Vehicle("FBI", CarSpawn.Spawn); _meCar.Heading = CarSpawn.Heading; _meCar.IsInvincible = true; _meCar.TopSpeed = 100f; _me = new Ped("s_m_m_highsec_01", _position, 0f); _main = false; _nearestMe = "PB"; "Closest to Paleto Bay Location".AddLog(); } _MEBlip = new Blip(_position) { Sprite = BlipSprite.GangAttackPackage, Color = Color.DarkOrange, Name = "Medical Examiner" }; _cData = Serializer.LoadItemFromXML <CaseData>(Main.CDataPath); "Sexual Assault Case Update".DisplayNotification("Visit ~o~Medical Examiner~w~ for update", _cData.Number); _state = ELocation.Dispatched; InteriorHelper.IsCoronerInteriorEnabled = true; return(true); }
public void Close() { _state = ELocation.Within15; if (_MEBlip.Exists()) { _MEBlip.Delete(); } NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(_me, Game.LocalPlayer.Character, -1); Game.DisplayHelp("Approach the ~y~Driver~w~ to go to the Medical Examiner's Office"); _dialogstate = EDialog.Pre; Dialog d = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.MeDriver, _me), _me.Position); d.AddPed(0, Game.LocalPlayer.Character); d.AddPed(1, _me); DeactivateStage(Close); }
public Bridge(Room roomFirst, Room roomSecond, ELocation location = ELocation.HORIZONTAL) { if (location == ELocation.HORIZONTAL) { position.X = roomFirst.GetPosition().X + (roomFirst.GetHeight() / 2); position.Y = roomFirst.GetPosition().Y + roomFirst.GetWidth() - 1; height = 3; width = (int)(roomSecond.GetPosition().Y - position.Y + 5); places = new char[height, width]; SetColors(); for (int i = 0; i < height; ++i) { for (int j = 0; j < width; ++j) { places[i, j] = Game.world.map[(int)(position.X + i), (int)(position.Y + j)]; } } for (int i = 0; i < width; ++i) { places[1, i] = '.'; colors[1, i] = ConsoleColor.DarkGray; } for (int i = 0; i < height; ++i) { for (int j = 0; j < width; ++j) { if (places[i, j] != '.') { places[i, j] = '#'; colors[i, j] = ConsoleColor.DarkYellow; } } } } else { position.X = roomFirst.GetPosition().X + roomFirst.GetHeight() - 1; position.Y = roomFirst.GetPosition().Y + roomFirst.GetWidth() / 2; width = 3; height = (int)(roomSecond.GetPosition().X - position.X + 5); places = new char[height, width]; SetColors(); for (int i = 0; i < height; ++i) { for (int j = 0; j < width; ++j) { places[i, j] = Game.world.map[(int)(position.X + i), (int)(position.Y + j)]; } } for (int i = 0; i < height; ++i) { places[i, 1] = '.'; //colors[1, i] = ConsoleColor.DarkGray; } for (int i = 0; i < height; ++i) { for (int j = 0; j < width; ++j) { if (places[i, j] != '.') { places[i, j] = '#'; colors[i, j] = ConsoleColor.DarkYellow; } } } } }
public VerticalHealthBar(ELocation location) : base(location) { }
public VerticalHealthBar(ELocation location, Color fillerColor) : base(location, fillerColor) { }
public HorizontalHealthBar(ELocation location) : base(location) { }
public HorizontalHealthBar(ELocation location, Color fillerColor) : base(location, fillerColor) { }
public Document(string number, ELocation location) { Number = number; AddNotification(Assert.IsTrue(Validate(number, location), "Document", Notifications.DocumentNumberIsInvalid)); }
public void SetLocation(ELocation location) { Location = location; }
public Element(string tag, EDistance whichOne = EDistance.First, ELocation where = ELocation.In) { Tag = tag; WhichOne = whichOne; Where = where; }
/// <summary> /// Constructs a GameWidget by default /// </summary> public GameWidget() : base() { Location = DEFAULT_LOCATION; }