public ErrorCodes Rent(Character character, bool useCorporationWallet) { //egyaltalan rentelheto? if (DocumentConfig.IsRentable) { if (_validUntil == null) { return(ErrorCodes.ConsistencyError); } _validUntil = ((DateTime)_validUntil).AddDays(DocumentConfig.rentPeriodDays); ErrorCodes ec; if ((ec = UpdateValidUntil()) != ErrorCodes.NoError) { return(ec); } CorporationDocumentHelper.CashInCreditForDocument(DocumentConfig.rentPrice, character, TransactionType.DocumentRent, useCorporationWallet); return(ErrorCodes.NoError); } return(ErrorCodes.InvalidDocumentType); }
public ErrorCodes OnCreate(Character character, bool useCorporationWallet = false) { var ec = ErrorCodes.NoError; //itt minden mast is ellenorzunk if (maxPerCharacter > 0) { var amountByType = CorporationDocumentHelper.GetAmountByType(documentType, character); if (amountByType >= maxPerCharacter) { return(ErrorCodes.NotEnoughDocumentSlots); } } if (creationPrice > 0) { CorporationDocumentHelper.CashInCreditForDocument(creationPrice, character, TransactionType.DocumentCreate, useCorporationWallet); } return(ec); }