Esempio n. 1
0
        public static void PlayFunc(IPlayable player1, IRecordable player2)
        {
            player1.Play();
            Console.WriteLine("Please select the next command: record, pause or stop!");
            string action = Console.ReadLine();

            switch (action)
            {
            case "record": player2.Record(); RecordFunc(player1, player2); break;

            case "pause": player1.Pause();
                Console.WriteLine("Please select your next step: stop or play again!");
                string actionNext = Console.ReadLine();
                switch (actionNext)
                {
                case "stop": player1.Stop(); break;

                case "play": PlayFunc(player1, player2); break;

                default: Console.WriteLine("Please select a valid command!"); break;
                }
                break;

            case "stop": player1.Stop(); break;

            default: Console.WriteLine("Please select a valid command!"); break;
            }
        }
        static void Main(string[] args)
        {
            string myFile = "myFile";

            new XMLHandler(myFile).ShowInfoXML();
            new DOCHandler(myFile).ShowInfoDOC();
            new TXTHandler(myFile).ShowInfoTXT();

            new ExDevider("Ex3");

            Player myPlayer = new Player();

            IRecordable myRecorder = myPlayer as IRecordable;
            IPlayeble   myPlayeble = myPlayer as IPlayeble;

            IEnumerable instance = new ArrayList();

            Console.ReadKey();

            instance = instance as IQueryable;

            myPlayeble.Play();
            myRecorder.Record();
            myPlayeble.Stop();
            myRecorder.Stop();

            Console.ReadKey();
        }
Esempio n. 3
0
        public void RecordableRecordersAreRegistered()
        {
            IRecordable recordable = Substitute.For <IRecordable>();

            AbacusWriter.Instance.AddRecord(recordable);
            Assert.IsNotEmpty(AbacusWriter.Instance.RegisteredRecordables);
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            //создание экземпляра класса Player
            Player somePlayer = new Player();

            //вызов метода Play из интерфейса IPlayable
            somePlayer.Play();

            //upcast к интерфесу IPlayable
            IPlayable somePlayerAsIPlayable = somePlayer as IPlayable;

            //после upcast возможно вызвать методы Pause и Stop интерфеса IPlayable
            somePlayerAsIPlayable.Pause();
            somePlayerAsIPlayable.Stop();

            //вызов метода Record из интерфейса IRecordable
            somePlayer.Record();

            //upcast к интерфесу IPlayable
            IRecordable somePlayerAsIRecordable = somePlayer as IRecordable;

            //после upcast возможно вызвать методы Pause и Stop интерфеса IPlayable
            somePlayerAsIRecordable.Pause();
            somePlayerAsIRecordable.Stop();
        }
 internal SamplingRecordProvider(Environment environment, IEnvironmentService service,
     IRecordable recordable, int id, bool recordPeriodEnabled, TimeSpan recordPeriod)
     : base(environment, service, recordable, id)
 {
     this.recordPeriodEnabled = recordPeriodEnabled;
     this.recordPeriod = recordPeriod;
 }
 internal ValueRecordProvider(Environment environment, IEnvironmentService service,
     IRecordable recordable, int id, bool recordPeriodEnabled, TimeSpan recordPeriod,
     int batchSize, TimeSpan? batchPeriod)
     : base(environment, service, recordable, id, recordPeriodEnabled, recordPeriod)
 {
     this.batchSize = batchSize;
     this.batchPeriod = batchPeriod;
 }
Esempio n. 7
0
        public static byte[] Serialize(IRecordable obj)
        {
            var memoryStream = new MemoryStream();

            GetBinaryFormatter.Serialize(memoryStream, obj);
            memoryStream.Position = 0; // redundant
            return(memoryStream.ToArray());
        }
Esempio n. 8
0
 public void RemoveRecordable(IRecordable recordable)
 {
     if (dictionary.ContainsKey (recordable))
     {
         dictionary.Remove(recordable);
     } else
     {
         Debug.LogError ("Trying to remove a recordable but not found");
     }
 }
Esempio n. 9
0
 public void RemoveLastRecord(IRecordable recordable)
 {
     if (dictionary.ContainsKey (recordable))
     {
         dictionary [recordable].RemoveAt (dictionary [recordable].Count - 1);
     } else
     {
         Debug.LogError ("Trying to remove a record but not recordable found");
     }
 }
Esempio n. 10
0
 public void AddRecord(IRecordable recordable, Record record)
 {
     if (dictionary.ContainsKey (recordable))
     {
         dictionary [recordable].Add (record);
     } else
     {
         Debug.LogError ("Trying to save a record but not recordable found");
     }
 }
Esempio n. 11
0
 public List<Record> getRecords(IRecordable recordable)
 {
     if (dictionary.ContainsKey (recordable))
     {
         return dictionary [recordable];
     } else
     {
         Debug.LogError ("Trying to get all records from recordable but not recordable found");
         return null;
     }
 }
Esempio n. 12
0
        static void Main(string[] args)
        {
            Player playAndRecord = new Player();

            playAndRecord.Play();
            IPlayable player = playAndRecord as IPlayable;

            player.Pause();
            player.Stop();

            playAndRecord.Record();
            IRecordable recorder = playAndRecord as IRecordable;

            recorder.Pause();
            recorder.Stop();
        }
Esempio n. 13
0
        public void Add(IRecordable record)
        {
            Validator.CheckIsNull(record);

            if (this.records.Count == MaxCount)
            {
                IRecordable min = records.OrderBy(d => d.Score).ToList()[0];
                if (record.Score < min.Score)
                {
                    return;
                }
                this.records.Remove(min);
            }

            this.records.Add(record);
        }
Esempio n. 14
0
        static void Main(string[] args)
        {
            Player      player       = new Player();
            IRecordable recordDevice = player;
            IPlayable   playerDevice = player;

            recordDevice.Record();
            recordDevice.Pause();
            recordDevice.Stop();

            playerDevice.Play();
            playerDevice.Pause();
            playerDevice.Stop();

            Console.ReadLine();
        }
Esempio n. 15
0
        static void Main(string[] args)
        {
            Player    player = new Player();
            IPlayable music  = player;

            music.Play();
            music.Pause();
            music.Stop();

            IRecordable recorder = player;

            recorder.Record();
            recorder.Pause();
            recorder.Stop();

            Console.ReadKey();
        }
Esempio n. 16
0
        static void Main(string[] args)
        {
            Player    player         = new Player();
            IPlayeble playeblaPlayer = player as IPlayeble;

            playeblaPlayer.Play();
            playeblaPlayer.Stop();
            playeblaPlayer.Pause();

            IRecordable recoPlayer = player as IRecordable;

            recoPlayer.Record();
            recoPlayer.Pause();
            recoPlayer.Stop();

            Console.ReadLine();
        }
Esempio n. 17
0
        private void OnEnable()
        {
            // Get properties from serializedObject
            recordGameObject = serializedObject.FindProperty("recordGameObject");
            recordFrom       = serializedObject.FindProperty("recordFrom");
            recordFromIndex  = serializedObject.FindProperty("recordFromIndex");
            recordName       = serializedObject.FindProperty("recordName");
            recordNameIndex  = serializedObject.FindProperty("recordNameIndex");
            recordOnStart    = serializedObject.FindProperty("_recordOnStart");

            timeStep = serializedObject.FindProperty("_timeStep");

            // Retrieve the gameobject to which the component is attached
            var component = (serializedObject.targetObject as Component);

            _recordable = (component as IRecordable);
        }
Esempio n. 18
0
        //Создайте 2 интерфейса IPlayable и IRecodable.В каждом из интерфейсов создайте по 3 метода void Play() / void Pause() / void Stop() и void Record() / void Pause() / void Stop() соответственно.
        //Создайте производный класс Player от базовых интерфейсов IPlayable и IRecodable.
        //Написать программу, которая выполняет проигрывание и запись.

        static void Main()
        {
            Player      player     = new Player();
            IPlayable   playable   = player;
            IRecordable recordable = player;

            player.Play();
            playable.Pause();
            ((IPlayable)player).Stop();

            Console.WriteLine();

            recordable.Record();
            recordable.Pause();
            (player as IRecordable).Stop();

            Console.ReadLine();
        }
Esempio n. 19
0
        static void Main(string[] args)
        {
            Player player = new Player();

            player.Play();
            IPlayable player1 = player as IPlayable;

            player1?.Pause();
            player1?.Stop();
            Console.WriteLine(new string('-', 80));
            player.Record();
            IRecordable recorder1 = player as IRecordable;

            recorder1.Pause();
            recorder1.Stop();

            Console.ReadLine();
        }
Esempio n. 20
0
        public PlayerRecorderWindow(IPlayable player, IRecordable recorder)
        {
            _recorder         = recorder;
            _recorder.OnTick += (o, e) => LbRecord.Text = $"{e:mm\\:ss}";

            _player         = player;
            _player.OnTick += (o, e) =>
            {
                if (!_isDragging)
                {
                    Pb.Value = (int)(e.PercentProgress * 100);
                }

                LbPlay.Text = $"{e.PlayedTime.Minutes:00}:{e.PlayedTime.Seconds:00}/{e.Duration.Minutes:00}:{e.Duration.Seconds:00}";
            };

            InitializeComponent();
        }
Esempio n. 21
0
        static void Main(string[] args)
        {
            Player player = new Player();

            IRecordable irec = player;
            IPlayable   ipl  = player;

            irec.Record();
            irec.Pause();
            irec.Stop();
            Console.WriteLine();
            ipl.Play();
            ipl.Pause();
            ipl.Stop();

            Console.WriteLine();
            Console.ReadLine();
        }
    void Start()
    {
        poseCalibration.onSuccess += PoseCalibration_onSuccess;

        switch (recordMode)
        {
        case RecordMode.Generic:
            recordable = new GenericRecorder(transforms, root);
            break;

        case RecordMode.GenericExperimental:
            recordable = new ExperimentalRecorder(root.gameObject);
            break;

        case RecordMode.Humanoid:
            recordable = new HumanoidRecoder(animatorAvatar.GetAnimator, animatorAvatar.GetHumanBodyBones);
            break;
        }
    }
Esempio n. 23
0
    //*******************************//
    // Private Methods               //
    //*******************************//
    public override void Deserialise(IRecordable snapShot)
    {
        //Has the object disappeared?
        if (!gameObject)
        {
            Debug.LogWarning("Couldnt Find Game Object: " + snapShot.objectName);
            //find the gameObject using name
            gameObject = GameObject.Find(snapShot.objectName);

            //Is the object still null?
            if(!gameObject)
            {
                Debug.LogWarning("Game object is not present in scene... Attempting to create the object");
                gameObject = GameObject.Instantiate(Resources.Load("Prefabs/Cube") as GameObject, Vector3.zero, Quaternion.identity) as GameObject;
                gameObject.name = snapShot.objectName;
            }
        }
        DynamicRecord data = (DynamicRecord)snapShot;
           // Debug.Log("Object " + name + " Position(" + data.positionX.ToString() + ", " + data.positionY.ToString() + ", " + data.positionZ + ")");
        gameObject.transform.position = data.position;
    }
        static void Main(string[] args)
        {
            Player player = new Player();

            Console.WriteLine("***Player***");
            IPlayable player1 = player;

            player1.Play();
            player1.Pause();
            player1.Stop();

            Console.WriteLine();

            Console.WriteLine("***Recorder***");
            IRecordable recorder = player;

            recorder.Record();
            recorder.Pause();
            recorder.Stop();

            Console.ReadKey();
        }
 public static byte[] Serialize(IRecordable obj) =>
 SerializationUtil.Serialize(obj);
Esempio n. 26
0
 public RecordProvider(IRecordable recordable)
 {
     recordable.ValidateNonNull(nameof(recordable));
     Recordable = recordable;
     records = new ReplaySubject<IRecord>(1);
 }
Esempio n. 27
0
 public abstract void WriteRecord(IRecordable value);
Esempio n. 28
0
 public void AddRecordable(IRecordable recordable)
 {
     dictionary.Add (recordable, new List<Record> ());
 }
 public StreamingRecordProvider(IRecordable recordable)
     : base(recordable)
 {
 }
Esempio n. 30
0
        public static IRecordable FixPrioritySigns(
            PrioritySignsTool.PrioritySignsMassEditMode massEditMode,
            List <ushort> segmentList)
        {
            if (segmentList == null || segmentList.Count == 0)
            {
                return(null);
            }

            IRecordable record = RecordRoad(segmentList);

            var primaryPrioType   = PriorityType.None;
            var secondaryPrioType = PriorityType.None;

            switch (massEditMode)
            {
            case PrioritySignsTool.PrioritySignsMassEditMode.MainYield: {
                primaryPrioType   = PriorityType.Main;
                secondaryPrioType = PriorityType.Yield;
                break;
            }

            case PrioritySignsTool.PrioritySignsMassEditMode.MainStop: {
                primaryPrioType   = PriorityType.Main;
                secondaryPrioType = PriorityType.Stop;
                break;
            }

            case PrioritySignsTool.PrioritySignsMassEditMode.YieldMain: {
                primaryPrioType   = PriorityType.Yield;
                secondaryPrioType = PriorityType.Main;
                break;
            }

            case PrioritySignsTool.PrioritySignsMassEditMode.StopMain: {
                primaryPrioType   = PriorityType.Stop;
                secondaryPrioType = PriorityType.Main;
                break;
            }
            }

            IExtSegmentEndManager segEndMan = Constants.ManagerFactory.ExtSegmentEndManager;

            void ApplyPrioritySigns(ushort segmentId, bool startNode)
            {
                ref NetSegment netSegment = ref segmentId.ToSegment();
                ushort         nodeId     = startNode ? netSegment.m_startNode : netSegment.m_endNode;

                TrafficPriorityManager.Instance.SetPrioritySign(
                    segmentId,
                    startNode,
                    primaryPrioType);

                ExtSegmentManager extSegmentManager = ExtSegmentManager.Instance;

                for (int i = 0; i < 8; ++i)
                {
                    ushort otherSegmentId = nodeId.ToNode().GetSegment(i);
                    if (otherSegmentId == 0 ||
                        otherSegmentId == segmentId ||
                        segmentList.Contains(otherSegmentId))
                    {
                        continue;
                    }

                    TrafficPriorityManager.Instance.SetPrioritySign(
                        otherSegmentId,
                        (bool)extSegmentManager.IsStartNode(otherSegmentId, nodeId),
                        secondaryPrioType);
                }
            }
Esempio n. 31
0
 public void UnSubscribe(IRecordable recordable)
 {
     recordables.Remove (recordable);
     memory.RemoveRecordable(recordable);
 }
Esempio n. 32
0
    /// <summary>
    /// Saves the state of a given object using the IRecordable class
    /// </summary>
    /// <param name='dataStruct'>
    /// The overrided IRecordable with the current stored data for this object
    /// </param>
    public static void SaveState(IRecordable dataStruct)
    {
        //Safety just incase this is called while not recording
        if(!SessionActive || !isStreaming)
            return;

        //Stop multiple adds of item... check if this frame exists
        if (!IsInFrame(dataStruct)) //Check if this dataStruct exists in this frame (The saved object has already been saved)
        {
            m_ObjectsUpdatedThisFrame[m_iAddedThisFrame] = dataStruct;
            m_iAddedThisFrame++;
        }
    }
Esempio n. 33
0
 /// <summary>
 /// Check to see if this Data is in the current frame already
 /// Stops duplicate entries, returns true is data is already in the list
 /// </summary>
 /// <param name="dataStruct"></param>
 /// <returns></returns>
 private static bool IsInFrame(IRecordable dataStruct)
 {
     for (int i = 0; i < m_iAddedThisFrame; i++)
     {
         if (m_ObjectsUpdatedThisFrame[i] == dataStruct)
             return true;
     }
     return false;
 }
Esempio n. 34
0
    /// <summary>
    /// Trims the watch lists. Optimisation
    /// </summary>
    public static void TrimWatchLists()
    {
        List<string> keys = new List<string>(m_DictOfRecords.Keys);

        foreach (string k in keys)
        {
            int count = 0;
            IRecordable[] original;     //The original values
            IRecordable[] trim;         //The trimmed list

            //Count the array until we hit a null
            if (m_DictOfRecords.TryGetValue(k, out original))
            {
                //There is data inside this index
                for (int i = 0; i < original.Length; i++)
                {
                    if(original[i] != null)
                        count++;
                    else
                        break;
                }
                //Create a 'trimmed' list of the exact size
                trim = new IRecordable[count];

                //copy the data into the the trimed list
                Array.Copy(original, 0, trim, 0, count);

                //Copy trimmed list back into the dictionary
                m_DictOfRecords[k] = trim;
            }

        }
    }
Esempio n. 35
0
    /// <summary>
    /// This should be called once each fixed update
    /// This method streams the playback data to the correct game objects in the scene
    /// </summary>
    public static void StreamRecording()
    {
        int currentFrame = PlaybackManager.GetCurrentFrame();

        //Check to see if this frame is in the Dictionary... if not return as there is no data to stream
        if(!m_DictOfRecords.ContainsKey(currentFrame.ToString()))
            return;

        IRecordable[] updatedThisFrame = new IRecordable[m_DictOfRecords[currentFrame.ToString()].Length];
        updatedThisFrame = m_DictOfRecords[currentFrame.ToString()];
        //Debug.Log("Num frame: " + currentFrame.ToString());

        //Foreach value in list... get gameobject and call its Restore state method passing over its structure of data
        for(int i = 0; i < updatedThisFrame.Length; i++)
        {
            if (updatedThisFrame[i] == null)
                Debug.Log("Object " + updatedThisFrame[i].objectName + " is null");
            updatedThisFrame[i].Deserialise(updatedThisFrame[i]);
        }
    }
 internal StreamingRecordProvider(Environment environment, IEnvironmentService service,
     IRecordable recordable, int id, Guid streamManagerId)
     : base(environment, service, recordable, id)
 {
     streamManager = StreamManagers.Instance.GetItem(streamManagerId);
 }
Esempio n. 37
0
 void Start()
 {
     myRecorder = new DynamicRecord();
 }
Esempio n. 38
0
        public override void OnPrimaryClickOverlay()
        {
            if (ControlIsPressed || ShiftIsPressed)
            {
                if (HoveredSegmentId == 0)
                {
                    return;
                }
                SelectedNodeId = 0;
                MainTool.RequestOnscreenDisplayUpdate();
            }

            if (massEditMode == PrioritySignsMassEditMode.Undo)
            {
                record_?.Restore();
            }
            else if (ControlIsPressed && ShiftIsPressed)
            {
                Log.Info("Before FixRoundabout/FixRoad."); // log time for benchmarking.
                bool isRoundabout = RoundaboutMassEdit.Instance.FixRoundabout(
                    HoveredSegmentId, out record_);
                if (!isRoundabout)
                {
                    record_ = PriorityRoad.FixRoad(HoveredSegmentId);
                }
                // TODO: benchmark why bulk setup takes a long time.
                Log.Info("After FixRoundabout/FixRoad. Before RefreshMassEditOverlay"); // log time for benchmarking.
                RefreshMassEditOverlay();
                Log.Info("After RefreshMassEditOverlay.");                              // log time for benchmarking.
            }
            else if (ControlIsPressed)
            {
                record_ = new TrafficRulesRecord();
                (record_ as TrafficRulesRecord).AddNodeAndSegmentEnds(HoveredNodeId);
                PriorityRoad.FixHighPriorityJunction(HoveredNodeId);
            }
            else if (ShiftIsPressed)
            {
                bool isRoundabout = RoundaboutMassEdit.Instance.TraverseLoop(HoveredSegmentId, out var segmentList);
                if (!isRoundabout)
                {
                    var segments = SegmentTraverser.Traverse(
                        HoveredSegmentId,
                        TraverseDirection.AnyDirection,
                        TraverseSide.Straight,
                        SegmentStopCriterion.None,
                        (_) => true);
                    segmentList = new List <ushort>(segments);
                }

                PriorityRoad.FixPrioritySigns(massEditMode, segmentList);
                record_ = null;
            }
            else
            {
                if (TrafficPriorityManager.Instance.HasNodePrioritySign(HoveredNodeId))
                {
                    return;
                }

                if (!MayNodeHavePrioritySigns(HoveredNodeId))
                {
                    return;
                }

                SelectedNodeId = HoveredNodeId;
                MainTool.RequestOnscreenDisplayUpdate();
                // Log._Debug($"PrioritySignsTool.OnPrimaryClickOverlay: SelectedNodeId={SelectedNodeId}");
            }

            // cycle mass edit mode
            if (ControlIsPressed)
            {
                massEditMode =
                    massEditMode != PrioritySignsMassEditMode.MainYield ?
                    PrioritySignsMassEditMode.MainYield :
                    PrioritySignsMassEditMode.Undo;
            }
            else if (ShiftIsPressed)
            {
                massEditMode++;
                if (massEditMode > PrioritySignsMassEditMode.Max)
                {
                    massEditMode = PrioritySignsMassEditMode.Min;
                }
            }

            // refresh cache
            if (ControlIsPressed)
            {
                RefreshMassEditOverlay();
            }
            else
            {
                RefreshCurrentPriorityNodeIds();
            }
        }
Esempio n. 39
0
 public void Subscribe(IRecordable recordable)
 {
     recordables.Add (recordable);
     memory.AddRecordable(recordable);
 }
Esempio n. 40
0
 /// <summary>
 /// Registers a recordable
 /// </summary>
 /// <param name="value">The recordable</param>
 public void AddRecord(IRecordable value)
 {
     recordables.Add(value);
 }
Esempio n. 41
0
        static void Main(string[] args)
        {
            bool        flag = true;
            int         choice;
            Player      player            = new Player();
            IPlayable   playableMethods   = player;
            IRecordable recordableMethods = player;

            Console.WriteLine("Добро пожаловать в плеер! Выберите, что вы хотите сделать:");
            Console.WriteLine("1.Начать проигрывание");
            Console.WriteLine("2.Поставить проигрывание на паузу");
            Console.WriteLine("3.Остановить проигрыывание");
            Console.WriteLine("4.Начать запись");
            Console.WriteLine("5.Поставить запись на паузу");
            Console.WriteLine("6.Остановить запись");
            Console.WriteLine("7.Выключить");
            while (flag)
            {
                choice = int.Parse(Console.ReadLine());
                switch (choice)
                {
                case 1:
                    player.Play();
                    Console.WriteLine("Выберете следующие действие:");
                    break;

                case 2:
                    playableMethods.Pause();
                    Console.WriteLine("Выберете следующие действие:");
                    break;

                case 3:
                    playableMethods.Stop();
                    Console.WriteLine("Выберете следующие действие:");
                    break;

                case 4:
                    player.Record();
                    Console.WriteLine("Выберете следующие действие:");
                    break;

                case 5:
                    recordableMethods.Pause();
                    Console.WriteLine("Выберете следующие действие:");
                    break;

                case 6:
                    recordableMethods.Stop();
                    Console.WriteLine("Выберете следующие действие:");
                    break;

                case 7:
                    Console.WriteLine("Выключение");
                    flag = false;
                    break;

                default:
                    Console.WriteLine("Неверный ввод!");
                    break;
                }
            }
            Console.ReadKey();
        }
Esempio n. 42
0
        public static IRecordable FixPrioritySigns(
            PrioritySignsTool.PrioritySignsMassEditMode massEditMode,
            List <ushort> segmentList)
        {
            if (segmentList == null || segmentList.Count == 0)
            {
                return(null);
            }

            IRecordable record = RecordRoad(segmentList);

            var primaryPrioType   = PriorityType.None;
            var secondaryPrioType = PriorityType.None;

            switch (massEditMode)
            {
            case PrioritySignsTool.PrioritySignsMassEditMode.MainYield: {
                primaryPrioType   = PriorityType.Main;
                secondaryPrioType = PriorityType.Yield;
                break;
            }

            case PrioritySignsTool.PrioritySignsMassEditMode.MainStop: {
                primaryPrioType   = PriorityType.Main;
                secondaryPrioType = PriorityType.Stop;
                break;
            }

            case PrioritySignsTool.PrioritySignsMassEditMode.YieldMain: {
                primaryPrioType   = PriorityType.Yield;
                secondaryPrioType = PriorityType.Main;
                break;
            }

            case PrioritySignsTool.PrioritySignsMassEditMode.StopMain: {
                primaryPrioType   = PriorityType.Stop;
                secondaryPrioType = PriorityType.Main;
                break;
            }
            }

            IExtSegmentEndManager segEndMan = Constants.ManagerFactory.ExtSegmentEndManager;

            void ApplyPrioritySigns(ushort segmentId, bool startNode)
            {
                ushort nodeId = netService.GetSegmentNodeId(
                    segmentId,
                    startNode);

                TrafficPriorityManager.Instance.SetPrioritySign(
                    segmentId,
                    startNode,
                    primaryPrioType);

                for (int i = 0; i < 8; ++i)
                {
                    ushort otherSegmentId = nodeId.ToNode().GetSegment(i);
                    if (otherSegmentId == 0 ||
                        otherSegmentId == segmentId ||
                        segmentList.Contains(otherSegmentId))
                    {
                        continue;
                    }

                    TrafficPriorityManager.Instance.SetPrioritySign(
                        otherSegmentId,
                        (bool)netService.IsStartNode(otherSegmentId, nodeId),
                        secondaryPrioType);
                }
            }

            // TODO avoid settin up the same node two times.
            foreach (ushort segId in segmentList)
            {
                ApplyPrioritySigns(segId, true);
                ApplyPrioritySigns(segId, false);
            }

            return(record);
        }
Esempio n. 43
0
 public virtual void Deserialise(IRecordable snapShot)
 {
 }
 public SamplingRecordProvider(IRecordable recordable)
     : base(recordable)
 {
 }
Esempio n. 45
0
 public static void LogMessage(string message, IRecordable recordable)
 {
     recordable.AppendText(message);
 }