CODE |
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) Errors: + Multis/HouseFoundation.cs: CS0305: Line 2382: Using the generic type 'System.Collections.Generic.Queue< T>' requires '1' type arguments Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
CODE |
RunUO - [www.runuo.com] Version 2.0, Build 2553.23365 Core: Running on .NET Framework Version 2.0.50727 Core: Optimizing for 2 processors Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) Errors: + Custom Scripts 2.0/CarpetAddons/CarpetAddonDeed.cs: CS1502: Line 144: The best overloaded method match for 'Server.Items.BaseAdd on.CouldFit(Server.IPoint3D, Server.Map, Server.Mobile, ref Server.Multis.BaseHo use)' has some invalid arguments CS1503: Line 144: Argument '4': cannot convert from 'ref System.Collections. Generic.List<Server.Multis.BaseHouse>' to 'ref Server.Multis.BaseHouse' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
CODE |
using System; using System.Collections.Generic; using Server; using Server.Gumps; using Server.Items; using Server.Network; using Server.Multis; using Server.Targeting; namespace Server.Items { public class CarpetAddonDeed : BaseAddonDeed { public override BaseAddon Addon{ get{ return null; } } [Constructable] public CarpetAddonDeed() { Name = "carpet deed"; } public CarpetAddonDeed( Serial serial ) : base( serial ) { } public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) BoundingBoxPicker.Begin( from, new BoundingBoxCallback( BoundingBox_Callback ), null ); else from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } private void BoundingBox_Callback( Mobile from, Map map, Point3D start, Point3D end, object state ) { IPoint3D p = start as IPoint3D; if ( p == null || map == null ) return; int width = (end.X - start.X), height = (end.Y - start.Y); if ( width < 2 || height < 2 ) from.SendMessage( "The bounding targets must be at least a 3x3 box." ); else if ( IsChildOf( from.Backpack ) ) from.SendGump( new CarpetGump( this, p, map, width, height ) ); else from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); } } } namespace Server.Gumps { public class CarpetGump : Gump { private const int EntryCount = 3; private BaseAddonDeed m_Deed; private IPoint3D m_P3D; private Map m_Map; private int m_Width; private int m_Height; public CarpetGump( BaseAddonDeed deed, IPoint3D p, Map map, int width, int height ) : base( 30, 30 ) { m_Deed = deed; m_P3D = p; m_Map = map; m_Width = width; m_Height = height; AddPage( 0 ); AddBackground( 0, 0, 450, 180, 9200 ); AddAlphaRegion( 12, 12, 381, 22 ); AddHtml( 13, 13, 379, 20, "<BASEFONT COLOR=WHITE>Choose a carpet type</BASEFONT>", false, false ); AddAlphaRegion( 398, 12, 40, 22 ); AddAlphaRegion( 12, 39, 426, 129 ); AddImage( 400, 16, 9766 ); AddImage( 420, 16, 9762 ); AddPage( 1 ); int page = 1; for ( int i = 0, index = 0; i < CarpetInfo.Infos.Length; ++i, ++index ) { if ( index >= EntryCount ) { if ( (EntryCount * page) == EntryCount ) AddImage( 400, 16, 0x2626 ); AddButton( 420, 16, 0x15E1, 0x15E5, 0, GumpButtonType.Page, page + 1 ); ++page; index = 0; AddPage( page ); AddButton( 400, 16, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1 ); if ( (CarpetInfo.Infos.Length - (EntryCount * page)) < EntryCount ) AddImage( 420, 16, 0x2622 ); } CarpetInfo info = CarpetInfo.GetInfo( i ); for ( int j = 0; j < info.Entries.Length; ++j ) AddItem( 20 + (index * 140 ) + info.Entries[j].OffsetX, 46 + info.Entries[j].OffsetY, info.Entries[j].ItemID ); AddButton( 20 + (index * 140 ), 46, 1209, 1210, i+1, GumpButtonType.Reply, 0); } } public override void OnResponse( NetState sender, RelayInfo info ) { Mobile from = sender.Mobile; if ( info.ButtonID >= 1 ) { BaseAddon addon = new CarpetAddon( info.ButtonID-1, m_Width, m_Height ); Server.Spells.SpellHelper.GetSurfaceTop( ref m_P3D ); List<BaseHouse> houses = new List<BaseHouse>(); AddonFitResult res = addon.CouldFit( m_P3D, m_Map, from, ref houses ); if ( res == AddonFitResult.Valid ) addon.MoveToWorld( new Point3D( m_P3D ), m_Map ); else if ( res == AddonFitResult.Blocked ) from.SendLocalizedMessage( 500269 ); // You cannot build that there. else if ( res == AddonFitResult.NotInHouse ) from.SendLocalizedMessage( 500274 ); // You can only place this in a house that you own! else if ( res == AddonFitResult.DoorsNotClosed ) from.SendMessage( "You must close all house doors before placing this." ); if ( res == AddonFitResult.Valid ) { m_Deed.Delete(); if ( houses != null ) { foreach ( Server.Multis.BaseHouse h in houses ) h.Addons.Add( addon ); } } else { addon.Delete(); } } } } } |
CODE |
List<BaseHouse> houses = new List<BaseHouse>(); AddonFitResult res = addon.CouldFit( m_P3D, m_Map, from, ref houses ); |
CODE |
BaseHouse house = null; AddonFitResult res = addon.CouldFit( m_P3D, m_Map, from, ref house ); |
CODE |
if ( houses != null ) { foreach ( Server.Multis.BaseHouse h in houses ) h.Addons.Add( addon ); } |
CODE |
house.Addons.Add( addon ); |
CODE |
RunUO - [www.runuo.com] Version 2.0, Build 2553.23365 Core: Running on .NET Framework Version 2.0.50727 Core: Optimizing for 2 processors Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) Errors: + Custom Scripts 2.0/CarpetAddons/CarpetAddonDeed.cs: CS1579: Line 161: foreach statement cannot operate on variables of type 'Ser ver.Multis.BaseHouse' because 'Server.Multis.BaseHouse' does not contain a publi c definition for 'GetEnumerator' Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
CODE |
if ( houses != null ) { foreach ( Server.Multis.BaseHouse h in houses ) h.Addons.Add( addon ); } |
CODE |
house.Addons.Add( addon ); |