Beispiel #1
0
 public GameLogic(IEventAggregator eventAggregator, IGameState gameState, IPlayerSelection playerSelection,
                  [ImportMany] IEnumerable <PlayerAction> actions)
 {
     _eventAggregator = eventAggregator;
     _eventAggregator.Subscribe(this);
     _gameState       = gameState;
     _playerSelection = playerSelection;
     _actions         = actions;
 }
Beispiel #2
0
    // display person information
    private void ShowPlayersInfo()
    {
        IPlayerSelection ps = FrameworkManager.GenericInstance.GenericPlayerSelection;
        PersonMonitor    bm = BeckonManager.BeckonInstance.PersonMonitor;

        GUI.Box(new Rect(40, Screen.height - 250, 900, 200), "Beckon Debug Info. Frame: " + BeckonManager.BeckonInstance.LastFrame);
        Rect  rect        = new Rect(50, Screen.height - 250, 900, 25);
        float labelHeight = 25;

        GUI.color = Color.red;
        GUI.Label(rect, "expectedPlayersCount = " + ps.ExpectedPlayerCount);
        rect.y += labelHeight;
        List <int> pointerControllingTrackedObjects = new List <int>(ps.PointerControllingTrackedObjects);

        if (pointerControllingTrackedObjects.Count == 0)
        {
            GUI.Label(rect, "Mouse controling persons: None");
        }
        else
        {
            GUI.Label(rect, "Mouse controling persons: " + string.Join(", ", pointerControllingTrackedObjects.ConvertAll <string>((i) => { return(i.ToString()); }).ToArray()));
        }
        rect.y += labelHeight;
        GUI.Label(rect, "All Persons in System: " + string.Join(", ", pointerControllingTrackedObjects.ConvertAll <string>((i) => { return(i.ToString()); }).ToArray()));
        rect.y += labelHeight;
        int index = 0;

        foreach (int personID in bm.TrackedObjectsInSystem)
        {
            OmekFramework.Common.BasicTypes.SpaceTypes.Vector3 center2D, center3D;
            BeckonData.Persons[(uint)personID].CenterOfMass3D.Get(out center3D);
            BeckonData.Persons[(uint)personID].CenterOfMass2D.Get(out center2D);
            GUI.Label(rect, string.Format("{0} : Person {1}, GameID {2}, State: {6} ,Position {3}, Image Position {4}, PosType {5}",
                                          index++,
                                          personID,
                                          ps.PlayerIdOfTrackedObjectId(personID),
                                          center3D.ToString("0.00"),
                                          center2D.ToString("0.0"),
                                          bm.GetPositionType((uint)personID),
                                          bm.GetInferredState((uint)personID)));
            rect.y += labelHeight;
        }
    }
Beispiel #3
0
 public VisitorBenefit(IPlayerSelection playerSelection)
 {
     _playerSelection = playerSelection;
 }