コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
 public Element(string tag, List <Data> data, EDistance whichOne = EDistance.First, ELocation where = ELocation.In)
 {
     Tag      = tag;
     Data     = data;
     WhichOne = whichOne;
     Where    = where;
 }
コード例 #3
0
 public Element(string tag, Data data, EDistance whichOne = EDistance.First, ELocation where = ELocation.In)
 {
     Tag = tag;
     Data.Add(data);
     WhichOne = whichOne;
     Where    = where;
 }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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()));
            }
        }
コード例 #7
0
 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;
 }
コード例 #8
0
 void OnEnable()
 {
     if (_eLoc == ELocation.AutoDetect)
     {
         _eRealLoc = ELocation.END;
     }
 }
コード例 #9
0
 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;
         }
     }
 }
コード例 #10
0
 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);
 }
コード例 #11
0
 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;
 }
コード例 #12
0
ファイル: Event.cs プロジェクト: avramsimona98/EventPlanner
 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;
 }
コード例 #13
0
 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 });
 }
コード例 #14
0
 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;
 }
コード例 #15
0
 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);
 }
コード例 #16
0
        protected override void Awake()
        {
            base.Awake();

            _tips = GetComponentInParent <ATips>();
            Assert.IsNotNull(_tips);

            _eRealLoc = ELocation.END;
        }
コード例 #17
0
 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));
 }
コード例 #18
0
 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);
 }
コード例 #19
0
        public void SetLocation(ELocation eLoc)
        {
            if (_eLoc == eLoc)
            {
                return;
            }

            _eLoc = eLoc;
            if (gameObject.activeInHierarchy)
            {
                Execute();
            }
        }
コード例 #20
0
        // 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();
        }
コード例 #21
0
ファイル: Document.cs プロジェクト: andrebaltieri/NerdStore
        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));
            }
        }
コード例 #22
0
        // 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);
        }
コード例 #23
0
        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);
        }
コード例 #24
0
 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;
                 }
             }
         }
     }
 }
コード例 #25
0
 public VerticalHealthBar(ELocation location) : base(location)
 {
 }
コード例 #26
0
 public VerticalHealthBar(ELocation location, Color fillerColor) : base(location, fillerColor)
 {
 }
コード例 #27
0
 public HorizontalHealthBar(ELocation location) : base(location)
 {
 }
コード例 #28
0
 public HorizontalHealthBar(ELocation location, Color fillerColor) : base(location, fillerColor)
 {
 }
コード例 #29
0
ファイル: Document.cs プロジェクト: andrebaltieri/NerdStore
 public Document(string number, ELocation location)
 {
     Number = number;
     AddNotification(Assert.IsTrue(Validate(number, location), "Document", Notifications.DocumentNumberIsInvalid));
 }
コード例 #30
0
ファイル: GameWidget.cs プロジェクト: jpx/blazera
 public void SetLocation(ELocation location)
 {
     Location = location;
 }
コード例 #31
0
 public Element(string tag, EDistance whichOne = EDistance.First, ELocation where = ELocation.In)
 {
     Tag      = tag;
     WhichOne = whichOne;
     Where    = where;
 }
コード例 #32
0
ファイル: GameWidget.cs プロジェクト: jpx/blazera
 /// <summary>
 /// Constructs a GameWidget by default
 /// </summary>
 public GameWidget()
     : base()
 {
     Location = DEFAULT_LOCATION;
 }