Beispiel #1
0
        public Player Challenge(User other)
        {
            Game game = Community.AddFact(new Game());
            Player player = Community.AddFact(new Player(this, game, 0));
            Community.AddFact(new Player(other, game, 1));

            return player;
        }
Beispiel #2
0
        public Machine(string userName)
        {
            _community = new Community(new MemoryStorageStrategy())
                .AddAsynchronousCommunicationStrategy(new POXAsynchronousCommunicationStrategy(new POXConfigurationProvider()))
                .Register<CorrespondenceModel>()
                .Subscribe(() => _user);

            _user = _community.AddFact(new User(userName));
        }
        public MachineViewModel(
            Community community,
            MachineNavigationModel navigation)
        {
            _community = community;
            _navigation = navigation;

            _depUser = new Dependent(delegate
            {
                _user = String.IsNullOrEmpty(_navigation.UserName)
                    ? null
                    : _community.AddFact(new User(_navigation.UserName));
            });
        }
 // Business constructor
 public Claim(
     Identity identity
     ,User user
     ,IdentityService identityService
     )
 {
     InitializeResults();
     _identity = new PredecessorObj<Identity>(this, RoleIdentity, identity);
     _user = new PredecessorObj<User>(this, RoleUser, user);
     _identityService = new PredecessorObj<IdentityService>(this, RoleIdentityService, identityService);
 }
            public CorrespondenceFact CreateFact(FactMemento memento)
            {
                User newFact = new User(memento);

                // Create a memory stream from the memento data.
                using (MemoryStream data = new MemoryStream(memento.Data))
                {
                    using (BinaryReader output = new BinaryReader(data))
                    {
                        newFact._userName = (string)_fieldSerializerByType[typeof(string)].ReadData(output);
                    }
                }

                return newFact;
            }
 // Business constructor
 public Player(
     User user
     ,Game game
     ,int index
     )
 {
     InitializeResults();
     _user = new PredecessorObj<User>(this, RoleUser, user);
     _game = new PredecessorObj<Game>(this, RoleGame, game);
     _index = index;
 }
 // Fields
 // Results
 // Business constructor
 public ChatEnable(
     User user
     )
 {
     InitializeResults();
     _user = new PredecessorObj<User>(this, RoleUser, user);
 }
 // Business constructor
 public GameRequest(
     MatchmakingService matchmakingService
     ,User user
     )
 {
     _unique = Guid.NewGuid();
     InitializeResults();
     _matchmakingService = new PredecessorObj<MatchmakingService>(this, RoleMatchmakingService, matchmakingService);
     _user = new PredecessorObj<User>(this, RoleUser, user);
 }
 public ChallengeViewModel(User user, MainNavigationModel mainNavigation)
 {
     _user = user;
     _mainNavigation = mainNavigation;
 }
Beispiel #10
0
 public Player CreatePlayer(User person)
 {
     return Community.AddFact(new Player(person, this, 0));
 }