Exemplo n.º 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);
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 3
0
 private void EmitUnitSelected(GameUnit gameUnit, TimelineNode unit)
 {
     if (UnitSelected != null)
         UnitSelected(gameUnit, unit);
 }
Exemplo n.º 4
0
 private void EmitUnitChanged(GameUnit gameUnit, TimelineNode unit, Time time)
 {
     if (UnitChanged != null)
         UnitChanged(gameUnit, unit, time);
 }
Exemplo n.º 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));
        }
Exemplo n.º 6
0
 void HandleUnitSelected(GameUnit gameUnit, TimelineNode unit)
 {
     unit.Selected = true;
     player.SetStartStop(unit.Start.MSeconds, unit.Stop.MSeconds);
 }
Exemplo n.º 7
0
 void HandleUnitChanged(GameUnit gameUnit, TimelineNode unit, Time time)
 {
     player.CloseActualSegment();
     player.Pause();
     player.SeekTo(time.MSeconds, true);
 }
Exemplo n.º 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);
 }