Ejemplo n.º 1
0
 public PurchaseLotHandler(CityServerContext context, IRealestateDomain realestate, IDAFactory da, IDataService dataService)
 {
     Context          = context;
     GlobalRealestate = realestate;
     Realestate       = realestate.GetByShard(context.ShardId);
     DA          = da;
     DataService = dataService;
 }
Ejemplo n.º 2
0
 public NhoodHandler(CityServerContext context, IRealestateDomain realestate, IDAFactory da, IDataService dataService, IKernel kernel, Neighborhoods nhoods)
 {
     Context          = context;
     GlobalRealestate = realestate;
     Realestate       = realestate.GetByShard(context.ShardId);
     DA          = da;
     DataService = dataService;
     Kernel      = kernel;
     Nhoods      = nhoods;
 }
        public ServerNeighborhoodProvider([Named("ShardId")] int shardId, IRealestateDomain realestate, IDAFactory daFactory, IServerNFSProvider nfs)
        {
            OnMissingLazyLoad    = true;
            OnLazyLoadCacheValue = false;

            ShardId          = shardId;
            GlobalRealestate = realestate;
            Realestate       = realestate.GetByShard(shardId);
            DAFactory        = daFactory;
            NFS = nfs;
        }
Ejemplo n.º 4
0
        public LotContainer(IDAFactory da, LotContext context, ILotHost host, IKernel kernel, LotServerConfiguration config, IRealestateDomain realestate)
        {
            VM.UseWorld = false;
            DAFactory   = da;
            Host        = host;
            Context     = context;
            Kernel      = kernel;
            Config      = config;

            JobLot = (context.Id & 0x40000000) > 0;
            if (JobLot)
            {
                var jobPacked = Context.DbId - 0x200;
                var jobLevel  = (short)((jobPacked - 1) & 0xF);
                var jobType   = (short)((jobPacked - 1) / 0xF);
                LotPersist = new DbLot
                {
                    lot_id     = Context.DbId,
                    location   = Context.Id,
                    category   = LotCategory.money,
                    name       = "{job:" + jobType + ":" + jobLevel + "}",
                    admit_mode = 4
                };
                LotAdj       = new List <DbLot>();
                LotRoommates = new List <DbRoommate>();
                Terrain      = new VMTSOSurroundingTerrain();

                for (int y = 0; y < 3; y++)
                {
                    for (int x = 0; x < 3; x++)
                    {
                        Terrain.Roads[x, y] = 0xF; //crossroads everywhere
                    }
                }
            }
            else
            {
                using (var db = DAFactory.Get())
                {
                    LotPersist   = db.Lots.Get(context.DbId);
                    LotAdj       = db.Lots.GetAdjToLocation(context.ShardId, LotPersist.location);
                    LotRoommates = db.Roommates.GetLotRoommates(context.DbId);
                }
                Realestate = realestate.GetByShard(LotPersist.shard_id);
                GenerateTerrain();
            }
        }
Ejemplo n.º 5
0
        public TerrainController(CoreGameScreenController parent, IClientDataService ds, Network.Network network, IRealestateDomain domain, PurchaseLotRegulator purchaseRegulator)
        {
            this.Parent            = parent;
            this.DataService       = ds;
            this.PurchaseRegulator = purchaseRegulator;
            Network = network;

            PurchaseRegulator.OnError      += PurchaseRegulator_OnError;
            PurchaseRegulator.OnTransition += PurchaseRegulator_OnTransition;
            PurchaseRegulator.OnPurchased  += PurchaseRegulator_OnPurchased;
            Realestate = domain.GetByShard(network.MyShard.Id);

            CurrentHoverLot = new Binding <Lot>()
                              .WithMultiBinding(RefreshTooltip, "Lot_Price", "Lot_IsOnline", "Lot_Name", "Lot_NumOccupants", "Lot_LeaderID");

            CurrentCity = new Binding <City>().WithMultiBinding(RefreshCity, "City_ReservedLotInfo", "City_SpotlightsVector");
        }
Ejemplo n.º 6
0
        public ServerLotProvider([Named("ShardId")] int shardId, IRealestateDomain realestate, IDAFactory daFactory, IServerNFSProvider nfs)
        {
            OnMissingLazyLoad    = true;
            OnLazyLoadCacheValue = false;

            ShardId          = shardId;
            GlobalRealestate = realestate;
            Realestate       = realestate.GetByShard(shardId);
            DAFactory        = daFactory;
            NFS = nfs;
            CityRepresentation = new City()
            {
                City_NeighborhoodsVec          = ImmutableList.Create <uint>(),
                City_OnlineLotVector           = ImmutableList.Create <bool>(),
                City_ReservedLotVector         = ImmutableList.Create <bool>(),
                City_ReservedLotInfo           = ImmutableDictionary.Create <uint, bool>(),
                City_SpotlightsVector          = ImmutableList.Create <uint>(),
                City_Top100ListIDs             = ImmutableList.Create <uint>(),
                City_TopTenNeighborhoodsVector = ImmutableList.Create <uint>()
            };
        }