コード例 #1
0
        // Function from file: shuttles.dm
        public int toggleShuttle(string shuttleId = null, string dockHome = null, string dockAway = null, dynamic timed = null)
        {
            Obj_DockingPort_Mobile M = null;
            dynamic dockedAt         = null;
            string  destination      = null;

            M = this.getShuttle(shuttleId);

            if (!(M != null))
            {
                return(1);
            }
            dockedAt    = M.get_docked();
            destination = dockHome;

            if (Lang13.Bool(dockedAt) && dockedAt.id == dockHome)
            {
                destination = dockAway;
            }

            if (Lang13.Bool(timed))
            {
                if (M.request(this.getDock(destination)) != 0)
                {
                    return(2);
                }
            }
            else if (M.dock(this.getDock(destination)) != 0)
            {
                return(2);
            }
            return(0);
        }
コード例 #2
0
        // Function from file: laborshuttle.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Obj_DockingPort_Mobile M = null;
            dynamic S = null;


            if (Lang13.Bool(href_list["move"]))
            {
                M = GlobalVars.SSshuttle.getShuttle("laborcamp");

                if (!(M != null))
                {
                    Task13.User.WriteMsg("<span class='warning'>Cannot locate shuttle!</span>");
                    return(0);
                }
                S = M.get_docked();

                if (Lang13.Bool(S) && S.name == "laborcamp_away")
                {
                    Task13.User.WriteMsg("<span class='warning'>Shuttle is already at the outpost!</span>");
                    return(0);
                }
            }
            base.Topic(href, href_list, (object)(hsrc));
            return(null);
        }