Ejemplo n.º 1
0
        public ActionResult TestMap(string stopFrom = "", string stopTo = "")
        {
            var rnd      = new Random();
            var src      = rnd.Next(100, 5000);
            var dst      = rnd.Next(100, 5000);
            var allStops = DbDataManager.GetAllStops();

            if (stopFrom != "" && stopTo != "")
            {
                try
                {
                    src             = allStops.First(s => s.StopName == stopFrom).StopId;
                    dst             = allStops.First(s => s.StopName == stopTo).StopId;
                    ViewBag.Message = "";
                }
                catch
                {
                    ViewBag.Message = "Random útvonal";
                }
            }

            var now = DateTime.Now.TimeOfDay;
            var instructionsToShow = PathfinderManager.GetRoute(src, dst, new DateTime(2013, 03, 01, now.Hours, now.Minutes, now.Seconds));

            //var instructionsToShow = PathfinderManager.GetRoute(src, dst, new DateTime(2013, 03, 01, 16, 21, now.Seconds));
            //var instructionsToShow = PathfinderManager.GetRoute(src, dst, DateTime.Now);
            ViewBag.StopNames = allStops.Select(s => s.StopName).Distinct().ToArray();

            Utility.SetupCulture();
            return(View(instructionsToShow));
        }
Ejemplo n.º 2
0
 void Start()
 {
     transform.position = new Vector3(-2, -4, 0);
     _pathfinderManager = PathfinderManager.GetInstance();
     _target            = new Vector3(6, 6, 0);
     _ix = 0;
 }
Ejemplo n.º 3
0
 void Awake()
 {
     //Single instance
     if (_type == null)
     {
         _type = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Ejemplo n.º 4
0
    void Start()
    {
        _moverRef = GetComponent <ActorMovement>();
        Debug.Assert(_moverRef != null, "Didn't manage to find a ActorMovement.");

        _actionRef = GetComponent <ActionManager>();
        Debug.Assert(_moverRef != null, "Didn't manage to find a ActionManager.");

        _pathfinder = GameObject.FindObjectOfType <PathfinderManager>();
        Debug.Assert(_pathfinder != null, "Didn't manage to find a PathfinderManager.");

        _statsRef = GetComponent <ActorStats>();
        Debug.Assert(_statsRef != null, "Didn't manage to find a ActorStats.");
    }
Ejemplo n.º 5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();

            DbDataManager.initDatabase(HttpRuntime.AppDomainAppPath + "budapest_gtfs/", HttpRuntime.AppDomainAppPath + Path.DirectorySeparatorChar);

            Parallel.Invoke(
                () => DbDataManager.LoadCache(HttpRuntime.AppDomainAppPath + Path.DirectorySeparatorChar),
                () => PathfinderManager.InitializePathfinders()
                );
        }
Ejemplo n.º 6
0
        public RoomActor(uint Id, RoomActorType Type, uint ReferenceId, object ReferenceObject, Vector3 Position, int Rotation, RoomInstance Instance)
        {
            mId               = Id;
            mType             = Type;
            mReferenceId      = ReferenceId;
            mReferenceObject  = ReferenceObject;
            mPosition         = Position;
            mBodyRotation     = Rotation;
            mHeadRotation     = Rotation;
            mUpdateNeeded     = true;
            mStatusses        = new Dictionary <string, string>();
            mInstance         = Instance;
            mEnableClipping   = true;
            mMovementSyncRoot = new object();

            mPathfinder = PathfinderManager.CreatePathfinderInstance();
            mPathfinder.SetRoomInstance(mInstance, Id);
        }
Ejemplo n.º 7
0
 public SpaceActor(uint uint_2, SpaceActorType Type, uint ReferenceId, object ReferenceObject, Vector3 Position, int Rotation, SpaceInstance Instance)
 {
     this.uint_0           = uint_2;
     this.spaceActorType_0 = Type;
     this.uint_1           = ReferenceId;
     this.object_0         = ReferenceObject;
     this.vector3_0        = Position;
     this.vector3_1        = Position;
     this.int_0            = Rotation;
     this.bool_0           = false;
     this.bool_6           = false;
     this.bool_3           = false;
     this.bool_4           = false;
     this.dictionary_0     = new Dictionary <string, string>();
     this.spaceInstance_0  = Instance;
     this.bool_1           = true;
     this.object_1         = new object();
     this.pathfinder_0     = PathfinderManager.CreatePathfinderInstance();
     this.pathfinder_0.SetSpaceInstance(this.spaceInstance_0, uint_2);
     this.method_1(500);
     this.method_2(500);
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     instance = this;
 }