예제 #1
0
        public EoiDataContract(CorporationWebContract contract)
        {
            this.Id = contract.Id;

            _coporationWebContract = contract;
            _blueprint             = EoiDataInterface.GetBlueprint(contract.BlueprintId);
        }
예제 #2
0
        public EoiDataAsset(FileSystemDataAsset fileSystemDataAsset)
        {
            if (fileSystemDataAsset == null)
            {
                return;
            }

            _fileSystemAsset = fileSystemDataAsset;

            this.Id = fileSystemDataAsset.TypeId;

            _type = EoiDataInterface.GetTypeById(this.Id);
        }
예제 #3
0
        public EoiDataBlueprint(StaticDataBlueprint staticBlueprint)
        {
            if (staticBlueprint == null)
            {
                Invalid = true;
                return;
            }

            _staticBlueprint = staticBlueprint;

            this.Id = staticBlueprint.Id;

            this.Products = new List <EoiDataType>();
            var products = _staticBlueprint.GetProducts();

            if (products == null)
            {
                this.Invalid = true;
                return;
            }
            foreach (var product in products)
            {
                var type = EoiDataInterface.GetType(product);
                if (type == null)
                {
                    this.Invalid = true;
                    return;
                }
                this.Products.Add(type);
            }


            this.Materials = new List <EoiDataType>();
            var materials = _staticBlueprint.GetMaterials();

            if (materials == null)
            {
                this.Invalid = true;
                return;
            }
            foreach (var material in materials)
            {
                var type = EoiDataInterface.GetType(material);
                if (type == null)
                {
                    this.Invalid = true;
                    return;
                }
                this.Materials.Add(type);
            }
        }
예제 #4
0
        public EoiDataAsset(RawEsiAsset esiAsset)
        {
            if (esiAsset != null)
            {
                this.Id = esiAsset.type_id;

                _type = EoiDataInterface.GetTypeById(this.Id);

                if (_fileSystemAsset == null)
                {
                    _fileSystemAsset = FileSystemDataInterface.CreateAsset(esiAsset.type_id, esiAsset.quantity);
                }
            }
        }
예제 #5
0
        internal void InitializeInvention()
        {
            var inventionProducts = _staticBlueprint.GetInventionProducts();

            if (inventionProducts != null)
            {
                foreach (var inventionProduct in inventionProducts)
                {
                    var blueprint = EoiDataInterface.GetBlueprint(inventionProduct.Id);
                    if (blueprint != null)
                    {
                        blueprint.Parent = this;
                    }
                }
            }
        }