Пример #1
0
 public GameUnitsStats(GameUnitsList guList, int duration)
 {
     game = new TimelineNode{Start=new Time(0), Stop=new Time(duration)};
     gameNode = new GameUnitStatsNode(game);
     gameUnitNodes = new Dictionary<GameUnit, GameUnitStatsNode>();
     GroupGameStats(guList);
 }
Пример #2
0
 bool Contained(TimelineNode node, TimelineNode parent)
 {
     if (node.Start > parent.Start && node.Stop < parent.Stop) {
         return true;
     } else if (node.Start > parent.Start && node.Stop > parent.Stop) {
         return (node.Stop - parent.Stop) < node.Duration * MAX_DIFF;
     } else if (node.Start < parent.Start && node.Stop < parent.Stop) {
         return (parent.Start - node.Start) < node.Duration * MAX_DIFF;
     } else {
         return false;
     }
 }
Пример #3
0
 private void EmitUnitSelected(GameUnit gameUnit, TimelineNode unit)
 {
     if (UnitSelected != null)
         UnitSelected(gameUnit, unit);
 }
Пример #4
0
 private void EmitUnitChanged(GameUnit gameUnit, TimelineNode unit, Time time)
 {
     if (UnitChanged != null)
         UnitChanged(gameUnit, unit, time);
 }
Пример #5
0
        private void StopGameUnit(GameUnit gameUnit)
        {
            TimelineNode timeInfo;
            Time start, stop;

            if (!gameUnitsStarted.ContainsKey(gameUnit)) {
                Log.Warning("Tryed to stop a game unit that was not started: " + gameUnit);
                return;
            }

            start = gameUnitsStarted[gameUnit];
            stop = new Time{MSeconds=(int)player.CurrentTime};
            timeInfo = new TimelineNode {Name=gameUnit.Name, Fps=fps, Start=start, Stop=stop};

            gameUnit.Add(timeInfo);
            gameUnitsStarted.Remove(gameUnit);
            Log.Debug(String.Format("Added new unit:{0} to {1} ", timeInfo, gameUnit));
        }
Пример #6
0
 void HandleUnitSelected(GameUnit gameUnit, TimelineNode unit)
 {
     unit.Selected = true;
     player.SetStartStop(unit.Start.MSeconds, unit.Stop.MSeconds);
 }
Пример #7
0
 void HandleUnitChanged(GameUnit gameUnit, TimelineNode unit, Time time)
 {
     player.CloseActualSegment();
     player.Pause();
     player.SeekTo(time.MSeconds, true);
 }
Пример #8
0
 void HandleUnitAdded(GameUnit gameUnit, int frame)
 {
     var unit = new TimelineNode {Name=gameUnit.Name, Fps=openedProject.Description.File.Fps};
     unit.StartFrame = (uint)(frame-50);
     unit.StopFrame = (uint)(frame+50);
     gameUnit.Add(unit);
 }