diff --git a/.gitignore b/.gitignore index 2dfcf13..d0557ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,41 @@ -# GitIgnore for DotNetHack -*/bin/*.* -*/bin/**/* -*/obj/**/* -*/bin -*/obj - -# ReSharper files -_ReSharper.*/* -_ReSharper.*/**/* -*.resharper.user - -# Visual Studio files -*.Publish.xml -*.suo -*.sln.cache -*.csproj.user -App_Data - -# MonoDevelop files -*.pidb -*.usertasks -*.userprefs -*.trx +# GitIgnore for DotNetHack +*/bin/*.* +*/bin/**/* +*/obj/**/* +*/bin +*/obj + +# ReSharper files +_ReSharper.*/* +_ReSharper.*/**/* +*.resharper.user + +# Visual Studio files +*.Publish.xml +*.suo +*.sln.cache +*.csproj.user +App_Data + +# MonoDevelop files +*.pidb +*.usertasks +*.userprefs +*.trx +.DS_Store + +src/.DS_Store +src/DotNetHack/bin/* +src/Plugins/DotNetHack.Plugin/bin/* +src/DotNetHack/bin/* +src/DotNetHack.Data/bin/* +src/DotNetHack.GameEngine/bin/* +src/DotNetHack.Serialization/bin/* +src/DotNetHack.Plugin/DotNetHack.Plugin.csproj +src/DotNetHack.AI/bin/* +src/DotNetHack.Serialization/bin/* +src/Plugins/DotNetHack.Plugin/bin/* +src/DotNetHack.Core/bin/* +src/DotNetHack.AI/bin/* +src/DotNetHack/bin/* +bin/* diff --git a/.gitignore~ b/.gitignore~ new file mode 100644 index 0000000..5fc406a --- /dev/null +++ b/.gitignore~ @@ -0,0 +1,41 @@ +# GitIgnore for DotNetHack +*/bin/*.* +*/bin/**/* +*/obj/**/* +*/bin +*/obj + +# ReSharper files +_ReSharper.*/* +_ReSharper.*/**/* +*.resharper.user + +# Visual Studio files +*.Publish.xml +*.suo +*.sln.cache +*.csproj.user +App_Data + +# MonoDevelop files +*.pidb +*.usertasks +*.userprefs +*.trx +.DS_Store + +src/.DS_Store +src/DotNetHack/bin/* +src/Plugins/DotNetHack.Plugin/bin/* +src/DotNetHack/bin/* +src/DotNetHack.Data/bin/* +src/DotNetHack.GameEngine/bin/* +src/DotNetHack.Serialization/bin/* +src/DotNetHack.Plugin/DotNetHack.Plugin.csproj +src/DotNetHack.AI/bin/* +src/DotNetHack.Serialization/bin/* +src/Plugins/DotNetHack.Plugin/bin/* +src/DotNetHack.Core/bin/* +src/DotNetHack.AI/bin/* +src/DotNetHack/bin/* +*/bin/* diff --git a/README.md b/README.md index ea9f418..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,9 +0,0 @@ -# D O T N E T H A C K - -Copyright (C) 2012 Peter J. Jensen - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/dat/cj_001.dungeon b/dat/cj_001.dungeon deleted file mode 100644 index 0a8aea8..0000000 Binary files a/dat/cj_001.dungeon and /dev/null differ diff --git a/dat/monsters.dat b/dat/monsters.dat deleted file mode 100644 index 4f7c022..0000000 --- a/dat/monsters.dat +++ /dev/null @@ -1 +0,0 @@ -0falsePassive0falsePassive58GrayBluefalsePassive \ No newline at end of file diff --git a/dat/sounds/ATTRIBUTION.md b/dat/sounds/ATTRIBUTION.md deleted file mode 100644 index 93183c6..0000000 --- a/dat/sounds/ATTRIBUTION.md +++ /dev/null @@ -1,16 +0,0 @@ - -http://www.freesound.org/people/DJ%20Chronos/sounds/123547/ -DJ Chronos June 29th, 2011 - -http://www.freesound.org/people/Erdie/sounds/27858/ -Erdie December 31st, 2006, This is another sword - -JoelAudio -August 16th, 2009 -A designed sword impact sound (MONO), Suitable for games and 3D positioning.Please thank me in the credits, Joel Azzopardi, if you use this sound. -http://www.freesound.org/people/JoelAudio/sounds/77611/ - -TicTacShutUp -April 5th, 2005 -Chain switch for a light being pulled. -http://www.freesound.org/people/TicTacShutUp/sounds/408/ diff --git a/dat/sounds/attack_sword_01.wav b/dat/sounds/attack_sword_01.wav deleted file mode 100644 index 88fc625..0000000 Binary files a/dat/sounds/attack_sword_01.wav and /dev/null differ diff --git a/dat/sounds/rubble_10.wav b/dat/sounds/rubble_10.wav deleted file mode 100644 index f8dbf76..0000000 Binary files a/dat/sounds/rubble_10.wav and /dev/null differ diff --git a/dat/sounds/switch_1.wav b/dat/sounds/switch_1.wav deleted file mode 100644 index e2a2734..0000000 Binary files a/dat/sounds/switch_1.wav and /dev/null differ diff --git a/dat/sounds/sword_hit_04.wav b/dat/sounds/sword_hit_04.wav deleted file mode 100644 index 193cf54..0000000 Binary files a/dat/sounds/sword_hit_04.wav and /dev/null differ diff --git a/dependencies/mysql-connector-net-6/CHANGES b/dependencies/mysql-connector-net-6/CHANGES new file mode 100755 index 0000000..7ec3094 --- /dev/null +++ b/dependencies/mysql-connector-net-6/CHANGES @@ -0,0 +1,43 @@ +6.5.4 +- Fix for Duplicate table name don't allow you to change table name (Oracle bug #13785918). +- Fix for Comment turns green the whole line (Oracle bug #13613856). +- Fix for CommandText property set method performance improvement (MySql bug #64012, Oracle bug #13739383). +- Fix for Foreign Keys not imported in Entity Model Wizard (Oracle bug #13800109). + +6.5.3 +- Return datetime values for timestamp fields as DateTimeKind.Local (MySQL bug #63812, Oracle bug #13591554) +- Fix for "Connector/Net Generates Incorrect SELECT Clause after UPDATE" (MySql bug #62134, Oracle bug #13491689). +- Fix for Error on intellisense when typing "-" (Orable Bug #13522344). +- Fix for VS IS SHOWING AN ERROR WHEN TRYING TO CREATE A FOREIGN KEY (Oracle bug #13511776). +- Made parser fully compliant with MySql 5.1. +- Fixed creation Trigger dialog bug (Oracle bug #13511801) +- Fix for Error when changing data length in table designer in varchar columns. (Oracle bug #13611677). +- Fix for Bug in Visual Studio Table Designer on editing column name the changes were not visually detected until focus is switched (Oracle bug #13613755). +- Fix for VS let you close the FK dialog even when the created FK do not have any data (Oracle bug #13613839). +- Fix for error when creating index through VS table designer. (Oracle bug # 13613765 - INDEX/KEYS ERROR MODIFYING COLUMNS FIELD). +- Fix on Bug #62801 (mysql.dev) #13491698 Orabug DB Strange behaviour with Include in LINQ-to-Entities. Changes on SelectStatement class on method GetDefaultColumnsForFragment to assign the table name when adding a new column. + The table name added for the new column had the wrong context of the fragment which was the cause of the problem. This fix assign the context right after the creation of the new ColumnFragment object. + Added Unit Tests VS2010 and VS2008. +- Fix for EF4.1, Code First, CreateDatabaseScript() generates an invalid MySQL script (MySQL bug #62150, Oracle bug #13582837). +- Fix for Connections not closed properly when using pooling (MySql bug #63942, Oracle bug #13629471). +- Changed behavior when MySqlCommand.CommandText is null, now it throws an InvalidOperationException instead of + NullReferenceException on ExecuteReader (MySql bug #64092, Oracle bug #13624659) +- Fixed Foreign Key Relationship list refresh when deleting a relationship (Oracle bug #13610283) +- Fixed unable to delete rows on Foreign Key Relationship screen (Oracle bug #13610235) +- Hides selected columns on Foreign Key Relationship screen (Oracle bug #13615258) +- Fix for unexpected closing of Add Function Import window when pressing Get Column Information (Oracle bug #13511736). +- Fix for bug where an attempt to save table data after the first save has occurred would fail (Oracle bug #13613714). +- Fix for ENTITY FRAMEWORK MODEL FAILS WHEN IS CREATED FROM DATABASE (Oracle bug #13610452). +- Fix for Bug on Installer failing to add registry entry causing that when creating a Project targeting .net framework different than 4.0v library was not listed. (Mysql bug #60462 Oracle bug #13491678). +- Fixed MySqlTime parsing to handle milliseconds (Oracle bug #13708884) +- Fix for SEXP-1ST FK RENAMED WHEN ADDING A NEW ONE (Oracle bug #13613824) +- Fix for Error when using Intellisense Quick Info (Oracle Bug #13739891). + +6.5.0 +- Added exception interception +- Implemented proper partial trust support +- Added command interception +- Integrated new parser and enhanced intellisense support +- Milliseconds are now supported when using MySQL 5.6 or later +- Made MySqlDateTime serializable (MySQL bug #40555, Oracle bug #11750161). +- Fix for Error on intellisense when typing "-" (Orable Bug #13522344). diff --git a/dependencies/mysql-connector-net-6/COPYING b/dependencies/mysql-connector-net-6/COPYING new file mode 100755 index 0000000..c123f2d --- /dev/null +++ b/dependencies/mysql-connector-net-6/COPYING @@ -0,0 +1,307 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software + interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as +a special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details + type 'show w'. This is free software, and you are welcome + to redistribute it under certain conditions; type 'show c' + for details. + +The hypothetical commands 'show w' and 'show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than 'show w' and +'show c'; they could even be mouse-clicks or menu items--whatever +suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program 'Gnomovision' (which makes passes at compilers) written + by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use +the GNU Lesser General Public License instead of this License. \ No newline at end of file diff --git a/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-us-secure-hash.html b/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-us-secure-hash.html new file mode 100755 index 0000000..26e0832 --- /dev/null +++ b/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-us-secure-hash.html @@ -0,0 +1,444 @@ + + + + + + MySQL :: MySQL 5.1 Reference Manual :: A.30 RFC 3174 - US Secure Hash Algorithm 1 (SHA1) License + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +Skip navigation links + + + + + + + + + +
+
+ + + + + + + +
+ + + +
+ + + + + + + + + +
+ + + + + + + + + \ No newline at end of file diff --git a/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-zlib-net.html b/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-zlib-net.html new file mode 100755 index 0000000..50f2d54 --- /dev/null +++ b/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-zlib-net.html @@ -0,0 +1,446 @@ + + + + + + MySQL :: MySQL 5.1 Reference Manual :: A.35 ZLIB.NET License + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +Skip navigation links + + + + + + + + + +
+
+ + + + + + + +
+ + + +
+ + + + + + + + + +
+ + + + + + + + + \ No newline at end of file diff --git a/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-zlib.html b/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-zlib.html new file mode 100755 index 0000000..1c8b105 --- /dev/null +++ b/dependencies/mysql-connector-net-6/Documentation/Licenses for Third-Party Components/license-zlib.html @@ -0,0 +1,444 @@ + + + + + + MySQL :: MySQL 5.1 Reference Manual :: A.34 zlib License + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +Skip navigation links + + + + + + + + + +
+
+ + + + + + + +
+ + + +
+ + + + + + + + + +
+ + + + + + + + + \ No newline at end of file diff --git a/dependencies/mysql-connector-net-6/Documentation/MySql.Data.chm b/dependencies/mysql-connector-net-6/Documentation/MySql.Data.chm new file mode 100755 index 0000000..5a1eb0d Binary files /dev/null and b/dependencies/mysql-connector-net-6/Documentation/MySql.Data.chm differ diff --git a/dependencies/mysql-connector-net-6/README b/dependencies/mysql-connector-net-6/README new file mode 100755 index 0000000..3cc0c61 --- /dev/null +++ b/dependencies/mysql-connector-net-6/README @@ -0,0 +1,45 @@ +MySQL Connector/Net 6.x + +This is a release of MySQL Connector/Net, Oracle's dual- +license ADO.Net Driver for MySQL. For the avoidance of +doubt, this particular copy of the software is released +under the version 2 of the GNU General Public License. +MySQL Connector/Net is brought to you by Oracle. + +Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + +License information can be found in the COPYING file. + +MySQL FOSS License Exception +We want free and open source software applications under +certain licenses to be able to use the GPL-licensed MySQL +Connector/NET (specified GPL-licensed MySQL client libraries) +despite the fact that not all such FOSS licenses are +compatible with version 2 of the GNU General Public License. +Therefore there are special exceptions to the terms and +conditions of the GPLv2 as applied to these client libraries, +which are identified and described in more detail in the +FOSS License Exception at + + +This distribution may include materials developed by third +parties. For license and attribution notices for these +materials, please refer to the documentation that accompanies +this distribution (see the "Licenses for Third-Party Components" +appendix) or view the online documentation at + + +The accompanying documentation currently exists in MSDN help +format and is located in the 'doc' directory. + +GPLv2 Disclaimer +For the avoidance of doubt, except that if any license choice +other than GPL or LGPL is available it will apply instead, +Oracle elects to use only the General Public License version 2 +(GPLv2) at this time for any software where a choice of GPL +license versions is made available with the language indicating +that GPLv2 or any later version may be used, or where a choice +of which version of the GPL is applied is otherwise unspecified. + +This software is OSI Certified Open Source Software. +OSI Certified is a certification mark of the Open Source Initiative. diff --git a/dependencies/mysql-connector-net-6/Release Notes.txt b/dependencies/mysql-connector-net-6/Release Notes.txt new file mode 100755 index 0000000..0e68783 --- /dev/null +++ b/dependencies/mysql-connector-net-6/Release Notes.txt @@ -0,0 +1,13 @@ +Connector/Net 6.5 Release Notes +------------------------------------ + +Welcome to the release notes for Connector/Net 6.5 + +What's new in 6.5 +-------------------- + +- Statement autocompletion and enhanced intellisense in Visual Studio +- Command and exception interception +- Proper partial trust support + +Be sure and check the documenation for more information on these new features. \ No newline at end of file diff --git a/dependencies/mysql-connector-net-6/v2/mysql.data.cf.dll b/dependencies/mysql-connector-net-6/v2/mysql.data.cf.dll new file mode 100755 index 0000000..caab890 Binary files /dev/null and b/dependencies/mysql-connector-net-6/v2/mysql.data.cf.dll differ diff --git a/dependencies/mysql-connector-net-6/v2/mysql.data.dll b/dependencies/mysql-connector-net-6/v2/mysql.data.dll new file mode 100755 index 0000000..088ef1c Binary files /dev/null and b/dependencies/mysql-connector-net-6/v2/mysql.data.dll differ diff --git a/dependencies/mysql-connector-net-6/v2/mysql.data.entity.dll b/dependencies/mysql-connector-net-6/v2/mysql.data.entity.dll new file mode 100755 index 0000000..0eb609f Binary files /dev/null and b/dependencies/mysql-connector-net-6/v2/mysql.data.entity.dll differ diff --git a/dependencies/mysql-connector-net-6/v2/mysql.visualstudio.dll b/dependencies/mysql-connector-net-6/v2/mysql.visualstudio.dll new file mode 100755 index 0000000..6229c26 Binary files /dev/null and b/dependencies/mysql-connector-net-6/v2/mysql.visualstudio.dll differ diff --git a/dependencies/mysql-connector-net-6/v2/mysql.web.dll b/dependencies/mysql-connector-net-6/v2/mysql.web.dll new file mode 100755 index 0000000..1403ab1 Binary files /dev/null and b/dependencies/mysql-connector-net-6/v2/mysql.web.dll differ diff --git a/dependencies/mysql-connector-net-6/v4/mysql.data.dll b/dependencies/mysql-connector-net-6/v4/mysql.data.dll new file mode 100755 index 0000000..0662a83 Binary files /dev/null and b/dependencies/mysql-connector-net-6/v4/mysql.data.dll differ diff --git a/dependencies/mysql-connector-net-6/v4/mysql.data.entity.dll b/dependencies/mysql-connector-net-6/v4/mysql.data.entity.dll new file mode 100755 index 0000000..0459920 Binary files /dev/null and b/dependencies/mysql-connector-net-6/v4/mysql.data.entity.dll differ diff --git a/dependencies/mysql-connector-net-6/v4/mysql.visualstudio.dll b/dependencies/mysql-connector-net-6/v4/mysql.visualstudio.dll new file mode 100755 index 0000000..e8836da Binary files /dev/null and b/dependencies/mysql-connector-net-6/v4/mysql.visualstudio.dll differ diff --git a/dependencies/mysql-connector-net-6/v4/mysql.web.dll b/dependencies/mysql-connector-net-6/v4/mysql.web.dll new file mode 100755 index 0000000..c1f0475 Binary files /dev/null and b/dependencies/mysql-connector-net-6/v4/mysql.web.dll differ diff --git a/lib/NAudio.dll b/lib/NAudio.dll deleted file mode 100644 index 75889dc..0000000 Binary files a/lib/NAudio.dll and /dev/null differ diff --git a/skael.dungeon b/skael.dungeon deleted file mode 100644 index 5ad9399..0000000 Binary files a/skael.dungeon and /dev/null differ diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index c072480..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# GitIgnore for IOneContactImport -# (c) 2011 -InterlinkONE.ContactImport/bin -InterlinkONE.ContactImport/obj -InterlinkONE.ContactImport.Installer/Debug -InterlinkONE.ContactImport.Installer/Release -*/obj -*/bin/*.* -*/bin/**/* -*/obj/**/* - -# ReSharper files -_ReSharper.*/* -_ReSharper.*/**/* -*.resharper.user - -# Visual Studio files -*.Publish.xml -*.suo -*.sln.cache -*.csproj.user -App_Data - -# MonoDevelop files -*.pidb -*.usertasks -*.userprefs - -TestResults diff --git a/src/DotNetHack.AI/AssemblyInfo.cs b/src/DotNetHack.AI/AssemblyInfo.cs new file mode 100644 index 0000000..ac55f92 --- /dev/null +++ b/src/DotNetHack.AI/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DotNetHack.AI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("pjensen")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/DotNetHack.AI/DotNetHack.AI.csproj b/src/DotNetHack.AI/DotNetHack.AI.csproj new file mode 100644 index 0000000..ad4aba4 --- /dev/null +++ b/src/DotNetHack.AI/DotNetHack.AI.csproj @@ -0,0 +1,74 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA} + Library + DotNetHack.AI + DotNetHack.AI + v4.5 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + + + none + true + bin\Release + prompt + 4 + false + false + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + + \ No newline at end of file diff --git a/src/DotNetHack.AI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/DotNetHack.AI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..771bbb1 Binary files /dev/null and b/src/DotNetHack.AI/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.csproj.FileListAbsolute.txt b/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..bd4d9e3 --- /dev/null +++ b/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.csproj.FileListAbsolute.txt @@ -0,0 +1,4 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.AI\bin\Debug\DotNetHack.AI.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.AI\bin\Debug\DotNetHack.AI.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.AI\obj\Debug\DotNetHack.AI.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.AI\obj\Debug\DotNetHack.AI.pdb diff --git a/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.dll b/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.dll new file mode 100644 index 0000000..3e17883 Binary files /dev/null and b/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.dll differ diff --git a/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.pdb b/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.pdb new file mode 100644 index 0000000..0ffc137 Binary files /dev/null and b/src/DotNetHack.AI/obj/Debug/DotNetHack.AI.pdb differ diff --git a/dat/exceptions.log b/src/DotNetHack.AI/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from dat/exceptions.log rename to src/DotNetHack.AI/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/xml/potions/arcane.xml b/src/DotNetHack.AI/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs similarity index 100% rename from xml/potions/arcane.xml rename to src/DotNetHack.AI/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs diff --git a/xml/potions/disease.xml b/src/DotNetHack.AI/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs similarity index 100% rename from xml/potions/disease.xml rename to src/DotNetHack.AI/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs diff --git a/src/DotNetHack.Core/AssemblyInfo.cs b/src/DotNetHack.Core/AssemblyInfo.cs new file mode 100644 index 0000000..b463d86 --- /dev/null +++ b/src/DotNetHack.Core/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DotNetHack.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("pjensen")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/DotNetHack.Core/DotNetHack.Core.csproj b/src/DotNetHack.Core/DotNetHack.Core.csproj new file mode 100644 index 0000000..da6f869 --- /dev/null +++ b/src/DotNetHack.Core/DotNetHack.Core.csproj @@ -0,0 +1,75 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1} + Library + DotNetHack.Core + DotNetHack.Core + v4.5 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + + + none + true + bin\Release + prompt + 4 + false + false + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + \ No newline at end of file diff --git a/src/DotNetHack.Core/Exceptions/DNHException.cs b/src/DotNetHack.Core/Exceptions/DNHException.cs new file mode 100644 index 0000000..725bebc --- /dev/null +++ b/src/DotNetHack.Core/Exceptions/DNHException.cs @@ -0,0 +1,12 @@ +using System; + +namespace DotNetHack.Core.Exceptions +{ + public class DNHException : Exception + { + public DNHException () + { + } + } +} + diff --git a/src/DotNetHack.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/DotNetHack.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..42fb504 Binary files /dev/null and b/src/DotNetHack.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.csproj.FileListAbsolute.txt b/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..4e0b6d7 --- /dev/null +++ b/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.csproj.FileListAbsolute.txt @@ -0,0 +1,4 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Core\bin\Debug\DotNetHack.Core.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Core\bin\Debug\DotNetHack.Core.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Core\obj\Debug\DotNetHack.Core.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Core\obj\Debug\DotNetHack.Core.pdb diff --git a/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.dll b/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.dll new file mode 100644 index 0000000..c043481 Binary files /dev/null and b/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.dll differ diff --git a/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.pdb b/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.pdb new file mode 100644 index 0000000..fc9fb43 Binary files /dev/null and b/src/DotNetHack.Core/obj/Debug/DotNetHack.Core.pdb differ diff --git a/xml/potions/frost.xml b/src/DotNetHack.Core/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from xml/potions/frost.xml rename to src/DotNetHack.Core/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/xml/potions/holy.xml b/src/DotNetHack.Core/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs similarity index 100% rename from xml/potions/holy.xml rename to src/DotNetHack.Core/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs diff --git a/xml/potions/nature.xml b/src/DotNetHack.Core/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs similarity index 100% rename from xml/potions/nature.xml rename to src/DotNetHack.Core/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs diff --git a/src/DotNetHack.Data/AssemblyInfo.cs b/src/DotNetHack.Data/AssemblyInfo.cs new file mode 100644 index 0000000..dfc5c1e --- /dev/null +++ b/src/DotNetHack.Data/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DotNetHack.Data")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("pjensen")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/DotNetHack.Data/Database.cs b/src/DotNetHack.Data/Database.cs new file mode 100644 index 0000000..a0de783 --- /dev/null +++ b/src/DotNetHack.Data/Database.cs @@ -0,0 +1,64 @@ +// +// Database.cs +// +// Author: +// PJensen +// +// Copyright (c) 2012 Peter J. Jensen +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + +using MySql.Data.MySqlClient; + +namespace DotNetHack.Data +{ + /// + /// DB + /// + public class Database + { + /// + /// Initializes a new instance of the class. + /// + public Database(string aServer, string aCatalog, string aUser, string aPassword = "") + { + // SqlConnection = new MySqlConnection( + // string.Format("Server={0};Database={1};Uid={2};Pwd={3};")); + } + + /// + /// Open this instance. + /// + public void Open() + { + // SqlConnection.Open(); + } + + /// + /// Close this instance. + /// + public void Close() + { + // SqlConnection.Close(); + } + + /// + /// Gets the sql connection. + /// + /// + /// The sql connection. + /// + /// public MySqlConnection SqlConnection{ get; set; } + } +} \ No newline at end of file diff --git a/src/DotNetHack.Data/DotNetHack.Data.csproj b/src/DotNetHack.Data/DotNetHack.Data.csproj new file mode 100644 index 0000000..c3fc6b7 --- /dev/null +++ b/src/DotNetHack.Data/DotNetHack.Data.csproj @@ -0,0 +1,81 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {BE13084A-561B-4B51-B546-68D662D64AF3} + Library + DotNetHack.Data + DotNetHack.Data + v4.5 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + + + none + true + bin\Release + prompt + 4 + false + false + + + + + ..\..\dependencies\mysql-connector-net-6\v4\mysql.data.dll + + + ..\..\dependencies\mysql-connector-net-6\v4\mysql.data.entity.dll + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + + \ No newline at end of file diff --git a/src/DotNetHack.Data/bin/Debug/mysql.data.dll b/src/DotNetHack.Data/bin/Debug/mysql.data.dll new file mode 100755 index 0000000..0662a83 Binary files /dev/null and b/src/DotNetHack.Data/bin/Debug/mysql.data.dll differ diff --git a/src/DotNetHack.Data/bin/Debug/mysql.data.entity.dll b/src/DotNetHack.Data/bin/Debug/mysql.data.entity.dll new file mode 100755 index 0000000..0459920 Binary files /dev/null and b/src/DotNetHack.Data/bin/Debug/mysql.data.entity.dll differ diff --git a/src/DotNetHack.Data/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/DotNetHack.Data/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..b9ed49d Binary files /dev/null and b/src/DotNetHack.Data/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.csproj.FileListAbsolute.txt b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..1398e63 --- /dev/null +++ b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Data\obj\Debug\DotNetHack.Data.csprojResolveAssemblyReference.cache +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Data\bin\Debug\DotNetHack.Data.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Data\bin\Debug\DotNetHack.Data.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Data\bin\Debug\mysql.data.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Data\bin\Debug\mysql.data.entity.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Data\obj\Debug\DotNetHack.Data.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Data\obj\Debug\DotNetHack.Data.pdb diff --git a/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.csprojResolveAssemblyReference.cache b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..7eb3524 Binary files /dev/null and b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.csprojResolveAssemblyReference.cache differ diff --git a/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.dll b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.dll new file mode 100644 index 0000000..f8a63ff Binary files /dev/null and b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.dll differ diff --git a/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.pdb b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.pdb new file mode 100644 index 0000000..fe6e809 Binary files /dev/null and b/src/DotNetHack.Data/obj/Debug/DotNetHack.Data.pdb differ diff --git a/xml/potions/none.xml b/src/DotNetHack.Data/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from xml/potions/none.xml rename to src/DotNetHack.Data/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/xml/potions/physical.xml b/src/DotNetHack.Data/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs similarity index 100% rename from xml/potions/physical.xml rename to src/DotNetHack.Data/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs diff --git a/xml/potions/poison.xml b/src/DotNetHack.Data/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs similarity index 100% rename from xml/potions/poison.xml rename to src/DotNetHack.Data/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs diff --git a/src/DotNetHack.Editor/DotNetHack.Editor.csproj b/src/DotNetHack.Editor/DotNetHack.Editor.csproj deleted file mode 100644 index 32d80cf..0000000 --- a/src/DotNetHack.Editor/DotNetHack.Editor.csproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {666F5001-AC74-4160-862A-3D5B79D23A65} - Exe - Properties - DotNetHack.Editor - DotNetHack.Editor - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - true - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - {0C36C4DD-060F-4E4F-A0A3-EFF2B8FD33BA} - DotNetHack - - - - - \ No newline at end of file diff --git a/src/DotNetHack.Editor/Editor.cs b/src/DotNetHack.Editor/Editor.cs deleted file mode 100644 index d90e032..0000000 --- a/src/DotNetHack.Editor/Editor.cs +++ /dev/null @@ -1,1055 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; - -using DotNetHack.UI; -using DotNetHack.Game; -using DotNetHack.Game.Dungeon; -using DotNetHack.Game.Dungeon.Tiles; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items; -using System.Threading; -using DotNetHack.Game.Items.Potions; -using DotNetHack.Game.Items.Potions.Elixers; -using DotNetHack.Utility; -using DotNetHack.Game.Dungeon.Generator; -using DotNetHack.Game.Dungeon.Tiles.Traps; -using DotNetHack.Game.NPC.Monsters; - -using System.Xml.Serialization.Persisted; -using System.IO; -using System.Reflection; -using DotNetHack.Game.Items.Equipment.Armor; -using DotNetHack.Game.Items.Equipment.Weapons; -using DotNetHack.Game.NPC; -using DotNetHack.Game.Items.Herbs; -using DotNetHack.Utility.Media; - -namespace DotNetHack.Editor -{ - /// - /// CommandProcessor - /// - /// input - public delegate void CommandProcessor(ConsoleKeyInfo k); - - /// - /// DNH Editor (2nd) Revision - /// - public class Editor - { - static List Colours = new List(); - - /// - /// No different than a mouse cursor. - /// - const char EDITOR_GLYPH = '#'; - - /// - /// The current location inside of the current map - /// - static Location3i CurrentLocation { get; set; } - - /// - /// The current map - /// - static Dungeon3 CurrentMap { get; set; } - - /// - /// The very last tile that was added to the mapped. Can - /// be used to repeat the last tile added. - /// - static Tile PreviousTile { get; set; } - - /// - /// The editor mode. - /// This can be switched using {F9 - F12} - /// - static EditorMode EditorMode { get; set; } - - /// - /// The list of monsters - /// - static List Monsters { get; set; } - - /// - /// CommandProcessor - /// - static CommandProcessor CommandProcessor { get; set; } - - /// - /// The current map file name - /// - static string CurrentMapFileName { get; set; } - - /// - /// The current guid, used to tie doors, keys, locked things, together. - /// The person editing is responsible for managing guids by using F4 to generate - /// a new Guid, all subsequent Doors, Keys, etc, will be created tying - /// them together. Once F4 is pressed again, the process repeats. - /// - static Guid CurrentGuid { get; set; } - - /// - /// Main - /// - /// - static void Main(string[] args) - { - - ProgressBar p1 = new ProgressBar("loading"); - p1.Show(); - - // Parse incoming args for the runtime env. - R.ParseArgs(args); - - // Load all monsters - try { Monsters = Persisted.Read>(R.MonsterFile); } - catch { UI.Graphics.MessageBox.Show("DNH-Edit", "Monster file not found!"); } - - // Show welcome message. - UI.Graphics.MessageBox.Show("DNH-Edit", "Welcome to DotNetHack-Editor!"); - - // Create a new map with a couple of floors - CurrentMap = new Dungeon3(UI.Graphics.ScreenWidth, UI.Graphics.ScreenHeight, 3); - - Console.SetWindowSize(UI.Graphics.ScreenWidth, UI.Graphics.ScreenHeight); - - CurrentLocation = new Location3i(UI.Graphics.ScreenCenter); - - // The last unit movement is recorded. - Location3i LastUnitMovement = Location3i.Origin3i; - - // The default is the "Layout" mode. - CommandProcessor = ProcessLayoutModeCommands; - - // Set the game engine run flags - GameEngine.RunFlags = - GameEngine.EngineRunFlags.Debug | - GameEngine.EngineRunFlags.Editor; - - #region Main Loop - redo__main_input: - try - { - var inkey = Console.ReadKey(); - Location3i UnitMovement = new Location3i(0, 0, 0); - - switch (inkey.Key) - { - #region Directional Keys - case ConsoleKey.LeftArrow: - UnitMovement.X--; - break; - case ConsoleKey.RightArrow: - UnitMovement.X++; - break; - case ConsoleKey.UpArrow: - UnitMovement.Y--; - break; - case ConsoleKey.DownArrow: - UnitMovement.Y++; - break; - case ConsoleKey.PageUp: - UnitMovement.D--; - break; - case ConsoleKey.PageDown: - UnitMovement.D++; - break; - #endregion - - #region Editor Control Commands - case ConsoleKey.Escape: - if (UI.Graphics.MessageBox.YesNo("Are you sure you want to exit?")) - return; - UI.Graphics.Display.Refresh(CurrentMap, CurrentLocation); - break; - case ConsoleKey.F1: - { - // Show File Menu - // (1) Save - // (2) Load - // (3) Exit - - Menu fileMenu = new Menu("Editor Menu", - new Menu.MenuAction[] - { - new Menu.MenuAction() - { - Name = "Exit", - ConsoleKey = "Escape", - MenuActionFilter = x => x.Key== ConsoleKey.D1, - MAction = delegate(object o) - { - - }, - }, - new Menu.MenuAction() - { - Name = "2", - ConsoleKey = "2", - MenuActionFilter = x => x.Key== ConsoleKey.D2, - MAction = delegate(object o) - { - - }, - }, - new Menu.MenuAction() - { - Name = "3", - MenuActionFilter = x => x.Key== ConsoleKey.D3, - MAction = delegate(object o) - { - - }, - }, - new Menu.MenuAction() - { - Name = "4", - MenuActionFilter = x => x.Key== ConsoleKey.D4, - MAction = delegate(object o) - { - }, - }, - }); - - fileMenu.Show(0, 0); - - fileMenu.Exec(null); - - UI.Graphics.Display.Refresh(CurrentMap, CurrentLocation); - - break; - } - case ConsoleKey.F5: - - // Create a new instance of the game engine with the current location and map. - GameEngine g = new GameEngine(new Player("Editor", CurrentLocation), - Util.DeepCopy(CurrentMap)); - - // Run the full out game engine except with editor and debug run flags. - g.Run(GameEngine.EngineRunFlags.Debug | GameEngine.EngineRunFlags.Editor, - ref args); - CurrentMap.DungeonRenderer.HardRefresh(CurrentLocation); - break; - - // generate a new guid. - case ConsoleKey.F4: - UI.Graphics.CursorToLocation(1, 1); - CurrentGuid = Guid.NewGuid(); - UI.Graphics.MessageBox.Show("Generated New Guid", - CurrentGuid.ToString()); - UI.Graphics.Display.Refresh(CurrentMap, CurrentLocation); - break; - // Change editor mode to "Layout" - case ConsoleKey.F9: - EditorMode = DotNetHack.Editor.EditorMode.Layout; - UI.Graphics.Display.ShowMessage("Changed to \"{0}\" mode.", EditorMode); - break; - // Change editor mode to "Items" - case ConsoleKey.F10: - EditorMode = DotNetHack.Editor.EditorMode.Items; - UI.Graphics.CursorToLocation(1, 1); - UI.Graphics.Display.ShowMessage("Changed to \"{0}\" mode.", EditorMode); - break; - case ConsoleKey.F11: - EditorMode = DotNetHack.Editor.EditorMode.Monsters; - UI.Graphics.Display.ShowMessage("Changed to \"{0}\" mode.", EditorMode); - break; - #endregion - - #region Map Load/Save Commands - /** - * Save - */ - case ConsoleKey.F2: - if (ConsoleModifiers.Control == inkey.Modifiers) - { - if (CurrentMapFileName == null) - { - UI.Graphics.CursorToLocation(1, 1); - Console.Write("Save As: "); - CurrentMapFileName = Console.ReadLine(); - } - - // save the map, but if this fails say so. - CurrentMap.SaveAs(CurrentMapFileName); - CurrentMap.DungeonRenderer.HardRefresh(CurrentLocation); - } - break; - /** - * Load - */ - case ConsoleKey.F3: - if (ConsoleModifiers.Control == inkey.Modifiers) - { - UI.Graphics.CursorToLocation(1, 1); - Console.Write("Load Dungeon: "); - string strLoadFile = Console.ReadLine(); - CurrentMap = Dungeon3.Load(strLoadFile); - CurrentMapFileName = strLoadFile; - CurrentMap.DungeonRenderer.HardRefresh(CurrentLocation); - } - break; - - #endregion - } - - // Depending on the editor "mode" re-wire the command procesor - // (kind of like a func pointer) - switch (EditorMode) - { - case DotNetHack.Editor.EditorMode.Layout: - CommandProcessor = ProcessLayoutModeCommands; - break; - case DotNetHack.Editor.EditorMode.Items: - CommandProcessor = ProcessItemModeCommands; - break; - case DotNetHack.Editor.EditorMode.Monsters: - CommandProcessor = ProcessMonsterModeCommands; - break; - } - - // Fire off command processor, be sure to see the switch above - CommandProcessor(inkey); - - // Record what the last UnitMovement was. - LastUnitMovement = UnitMovement; - - // Check the boundaries of the dungeon. - if (!CurrentMap.CheckBounds(CurrentLocation + UnitMovement)) - goto redo__main_input; - - // Add UnitMovement to the CurrentLocation. - CurrentLocation += UnitMovement; - - // Render - CurrentMap.Render(CurrentLocation); - - // Move cursor to current location - UI.Graphics.CursorToLocation(CurrentLocation); - - // Show the editor "hand" - Console.Write(EDITOR_GLYPH); - - // CursorToLocation - UI.Graphics.CursorToLocation(0, UI.Graphics.ScreenHeight - 1); - - Console.Write(CurrentLocation); - } - catch (Exception ex) - { - UI.Graphics.MessageBox.Show("DNH-Edit Exception", ex); - UI.Graphics.Display.Refresh(CurrentMap, CurrentLocation); - } - - // jump back to main input - goto redo__main_input; - - #endregion - } - - /// - /// Set tile - /// Makes things a bit cleaner. - /// - /// type - /// glyph - /// colour = standard. - static void SetTile(TileType t, char g, Colour c, Location3i location = null) - { - var tmpSetTile = new Tile() - { - G = g, - TileType = t, - C = c ?? Colour.Standard, - }; - - if (location == null) - { - location = CurrentLocation; - } - - // Store the previous tile. - CurrentMap.SetTile(location, tmpSetTile); - PreviousTile = tmpSetTile; - } - - /// - /// SetTile, adds the passed tile to this location. - /// - /// The tile to add to this location. - static void SetTile(Tile aTile) - { - CurrentMap.SetTile(CurrentLocation, aTile); - } - - /// - /// ProcessLayoutModeCommands - /// - /// The input - static void ProcessLayoutModeCommands(ConsoleKeyInfo input) - { - switch (input.Key) - { - #region Editing Commands - - // Add a new basic wall tile. - case ConsoleKey.Enter: - if (PreviousTile != null) - SetTile(PreviousTile.TileType, PreviousTile.G, PreviousTile.C); - break; - - // Add a stairs-up tile. - case ConsoleKey.OemPeriod: - SetTile(TileType.StairsUp, Symbols.ARROW_UP, Colour.Standard); - break; - - // Allow for deltion - case ConsoleKey.Delete: - switch (input.Modifiers) - { - default: - SetTile(TileType.Nothing, '.', Colour.Standard); - break; - case ConsoleModifiers.Control: - bool nothing = Graphics.MessageBox.YesNo("Are you Sure?"); - if (nothing) - { - clrScreen(TileType.Nothing, '.', Colour.Standard); - } - break; - } - break; - - case ConsoleKey.A: - SetTile(TileType.Altar, '_', Colour.Standard); - break; - - // Add stairs down tile. - case ConsoleKey.OemComma: - SetTile(TileType.StairsDown, Symbols.MOD_EQUAL, Colour.Standard); - break; - - // wall - case ConsoleKey.Insert: - SetTile(TileType.Wall, Symbols.SOLID, Colour.Standard); - break; - - // Adds a door. - case ConsoleKey.D: - switch (input.Modifiers) - { - default: - SetTile(Door.NewDoor(CurrentLocation)); - break; - case ConsoleModifiers.Shift: - if (CurrentGuid.Equals(Guid.Empty)) - throw new ApplicationException("Generate a new Guid using F4"); - SetTile(Door.NewDoor(CurrentGuid)); - break; - } - - break; - - - #region Out of Doors Tiles - - /// water - case ConsoleKey.W: - switch (input.Modifiers) - { - default: - char shade_glyph = Symbols.ALMOST_EQUAL; // default - switch (CurrentMap.GetTile(CurrentLocation).G) - { - default: - shade_glyph = Symbols.ALMOST_EQUAL; - break; - case Symbols.ALMOST_EQUAL: - shade_glyph = '~'; - break; - case '~': - shade_glyph = Symbols.ALMOST_EQUAL; - break; - } - - SetTile(TileType.Water, shade_glyph, Dice.RandomChoice(new Colour[] - { - Colour.Ocean, - Colour.DeepOcean, - })); - - break; - case ConsoleModifiers.Control: - bool water = Graphics.MessageBox.YesNo("Are you Sure?"); - if (water) - { - clrScreen(TileType.Water, Symbols.ALMOST_EQUAL, Colour.Ocean); - } - break; - } - break; - - // road - case ConsoleKey.R: - SetTile(TileType.Road, Symbols.FILL_LIGHT, Colour.Road); - break; - - // tree. - case ConsoleKey.T: - switch (input.Modifiers) - { - default: - SetTile(TileType.Tree, 'T', Colour.CurrentColour); - break; - - // Add a spike pit. - case ConsoleModifiers.Shift: - SetTile(new TrapSpikePit()); - break; - } - break; - // mountain - case ConsoleKey.M: - SetTile(TileType.Mountain, '^', Colour.Mountain); - break; - - // home - case ConsoleKey.H: - int tmpAdditionalSpawnTime = 0; // + base of 500 - Herb.HerbType tmpHerbType = Herb.HerbType.MotherWort; - switch (R.Random.Next(0, 8)) - { - case 0: - tmpAdditionalSpawnTime = 10; - tmpHerbType = Herb.HerbType.Amanita; - break; - case 1: - tmpAdditionalSpawnTime = 20; - tmpHerbType = Herb.HerbType.DeathCap; - break; - case 2: - tmpAdditionalSpawnTime = 30; - tmpHerbType = Herb.HerbType.Hibiscus; - break; - case 3: - tmpAdditionalSpawnTime = 50; - tmpHerbType = Herb.HerbType.MandrakeRoot; - break; - case 4: - tmpAdditionalSpawnTime = 60; - tmpHerbType = Herb.HerbType.MotherWort; - break; - case 5: - tmpAdditionalSpawnTime = 70; - tmpHerbType = Herb.HerbType.ShadeLeaf; - break; - case 6: - tmpAdditionalSpawnTime = 80; - tmpHerbType = Herb.HerbType.TigerLilly; - break; - case 7: - tmpAdditionalSpawnTime = 90; - tmpHerbType = Herb.HerbType.WhiteSage; - break; - case 8: - tmpAdditionalSpawnTime = 100; - tmpHerbType = Herb.HerbType.WolfsBane; - break; - } - - SetTile(HerbSpawn.NewHerbSpawn(tmpHerbType, tmpAdditionalSpawnTime)); - - break; - - // gress - case ConsoleKey.G: - switch (input.Modifiers) - { - default: - char shade_glyph = '\0'; - switch (CurrentMap.GetTile(CurrentLocation).G) - { - default: - shade_glyph = Symbols.FILL_MEDIUM; break; - case Symbols.FILL_HEAVY: - shade_glyph = Symbols.FILL_LIGHT; - break; - case Symbols.FILL_MEDIUM: - shade_glyph = Symbols.FILL_HEAVY; - break; - case Symbols.FILL_LIGHT: - shade_glyph = Symbols.FILL_MEDIUM; - break; - } - SetTile(TileType.Grass, shade_glyph, Colour.Grass); - break; - case ConsoleModifiers.Shift: - SetTile(TileType.Grave, Symbols.SMALL_T, Colour.Grave); - break; - case ConsoleModifiers.Control: - if (Graphics.MessageBox.YesNo("Are you Sure?")) - { - // clrScreen(TileType.Grass, Symbols.FILL_LIGHT, Colour.Grass); - CurrentMap.IterateDungeonData(delegate(int x, int y, int d) - { - CurrentLocation = new Location3i(x, y, d); - if (Dice.D(10.0)) - SetTile(new Tile(Symbols.FILL_HEAVY, Colour.Grass, TileFlags.None)); - else if (Dice.D(10)) - SetTile(new Tile(Symbols.FILL_MEDIUM, Colour.Grass, TileFlags.None)); - else if (Dice.D(10)) - SetTile(new Tile(Symbols.FILL_LIGHT, Colour.Grass, TileFlags.None)); - else - SetTile(new Tile(Symbols.FILL_LIGHT, Colour.Grass, TileFlags.None)); - }); - } - break; - } - break; - - // WARNING: Experimental. - case ConsoleKey.D1: - { - IDungeonGenerator g = new DungeonGeneratorRecursiveDescent(CurrentMap); - g.Generate(0); - CurrentMap.DungeonRenderer.HardRefresh(CurrentLocation); - break; - } - - // bridge horizontal, bridge vertical - case ConsoleKey.B: - switch (input.Modifiers) - { - default: - SetTile(TileType.Bridge, '■', Colour.Bridge); - break; - case ConsoleModifiers.Shift: - SetTile(TileType.Bridge, '▌', Colour.Bridge); - break; - case ConsoleModifiers.Alt: - SetTile(TileType.Beach, Symbols.FILL_LIGHT, - new Colour(ConsoleColor.Yellow, ConsoleColor.Green), - CurrentLocation); - break; - } - break; - case ConsoleKey.S: - switch (input.Modifiers) - { - default: - - SetTile(TileType.Forest, '&', - new Colour(ConsoleColor.Green, ConsoleColor.DarkGreen), - CurrentLocation); - break; - case ConsoleModifiers.Shift: - SetTile(TileType.Swamp, '&', - new Colour(ConsoleColor.DarkGreen, ConsoleColor.Green), - CurrentLocation); - break; - } - break; - - // Frieldly, fountain - case ConsoleKey.F: - switch (input.Modifiers) - { - default: - SetTile(TileType.Field, Symbols.FILL_LIGHT, Colour.Field); - break; - case ConsoleModifiers.Shift: - SetTile(TileType.Fountain, Symbols.FUNCTION, Colour.Fountain); - break; - } - break; - - #endregion - - #endregion - } - } - - /// - /// Clears the screen with specified tile - /// - static void clrScreen(TileType tileType, char symbol, Colour color) - { - Location3i tmpLocation = new Location3i(0, 0, CurrentLocation.D); - - // Fill entire map with tileType - for (int i = 0; i < Console.WindowHeight; i++) - { - for (int j = 0; j < Console.WindowWidth; j++) - { - tmpLocation.X = j; - tmpLocation.Y = i; - - SetTile(tileType, symbol, color, tmpLocation); - } - } - } - - /// - /// Sets an item at the current location. - /// - /// The item to set in the current location. - static void SetItem(IItem aItem) - { - // that'll do - CurrentMap.GetTile(CurrentLocation) - .Items.Push(aItem); - } - - /// - /// Spawns the passed monster at the current location. - /// - /// The monster to spawn. - /// Monster must be valid. - static void SetMonster(Monster m) - { - // satisfy preconditions. - if (m == null) - throw new ArgumentNullException("Monster cannot be null."); - else if (m.Stats == null) - throw new ArgumentNullException("Monster stats cannot be null."); - - // This is the part that needed to be abstracted away from callers. - m.Location = CurrentLocation; - - // Spawn the NPC in this map. - CurrentMap.SpawnNPC(m); - } - - /// - /// ProcessItemModeCommands - /// - /// The input7 - static void ProcessItemModeCommands(ConsoleKeyInfo input) - { - switch (input.Key) - { - // lock box - case ConsoleKey.L: - break; - case ConsoleKey.G: - int intGoldAmount = 0; - Input.GetInt(out intGoldAmount); - SetItem(new Currency(intGoldAmount)); - break; - case ConsoleKey.S: - int intSilverAmount = 0; - Input.GetInt(out intSilverAmount); - SetItem(new Currency(intSilverAmount, CurrencyModifier.SILVER)); - break; - case ConsoleKey.C: - int intCopperAmount = 0; - Input.GetInt(out intCopperAmount); - SetItem(new Currency(intCopperAmount, CurrencyModifier.COPPER)); - break; -#if DEBUG - - // WARNING: Experimental - // WARNING: Experimental - // WARNING: Experimental - // WARNING: Experimental - // WARNING: Experimental - - - // TODO: Remove this - case ConsoleKey.W: - { - // Add armour menu - // TODO: This is temporary until full out serialization. - Menu mArmour = new Menu("Add Weapon", new[] - { - new Menu.MenuAction() - { - Name = "Rusted Shortsword", - MAction = delegate(object argv) - { - SetItem(new RustedShortsword(CurrentLocation)); - }, - MenuActionFilter = (i => i.Key.Equals(ConsoleKey.D1)), - }, - new Menu.MenuAction() - { - Name = "Rusted Longsword", - MAction = delegate(object argv) - { - SetItem(new RustedLongsword(CurrentLocation)); - }, - MenuActionFilter = (i => i.Key.Equals(ConsoleKey.D2)), - }, - }); - mArmour.Show(1, 1); - mArmour.Exec(null); - UI.Graphics.Display.Refresh( - CurrentMap, CurrentLocation); - } - - break; - // TODO: Remove this - case ConsoleKey.A: - { - // Add armour menu - // TODO: This is temporary until full out serialization. - Menu mArmour = new Menu("Add Armour", new[] - { - new Menu.MenuAction() - { - Name = "Band of Salvation", - MAction = delegate(object argv) - { - SetItem(new BandOfSalvation(CurrentLocation)); - }, - MenuActionFilter = (i => i.Key.Equals(ConsoleKey.D1)), - }, - }); - mArmour.Show(1, 1); - mArmour.Exec(null); - UI.Graphics.Display.Refresh( - CurrentMap, CurrentLocation); - } - - break; -#endif - // Add a new potion, use menu to determine exactly which one. - case ConsoleKey.P: - { - Menu mPotion = new Menu("Select Potion Type", - new[] - { - new Menu.MenuAction() - { - Name = "Light Healing Potion", - MAction = delegate(object argv) - { - SetItem(new HealthPotion(PotionStrength.Light)); - }, - MenuActionFilter = (i => i.Key.Equals(ConsoleKey.D1)), - }, - new Menu.MenuAction() - { - Name = "Minor Healing Potion", - MAction = delegate(object argv) - { - SetItem(new HealthPotion(PotionStrength.Minor)); - }, - MenuActionFilter = (i => i.Key.Equals( ConsoleKey.D2)), - }, - new Menu.MenuAction() - { - Name = "Elixer of Strength", - MAction = delegate(object argv) - { - SetItem(new ElixerOfOgreStrength(PotionStrength.Strong)); - }, - MenuActionFilter = (i => i.Key == ConsoleKey.D0), - }, - new Menu.MenuAction() - { - Name = "Strong Healing Potion", - MAction = delegate(object argv) - { - SetItem(new HealthPotion(PotionStrength.Strong)); - }, - MenuActionFilter = (i => i.Key == ConsoleKey.D3), - }, - new Menu.MenuAction() - { - Name = "Greater Healing Potion", - MAction = delegate(object argv) - { - SetItem(new HealthPotion(PotionStrength.Greater)); - }, - MenuActionFilter = (i => i.Key == ConsoleKey.D4), - }, - new Menu.MenuAction() - { - Name = "Super Healing Potion", - MAction = delegate(object argv) - { - SetItem(new HealthPotion(PotionStrength.Super)); - }, - MenuActionFilter = (i => i.Key == ConsoleKey.D4), - }, - }); - mPotion.Show(1, 1); - mPotion.Exec(null); - UI.Graphics.Display.Refresh( - CurrentMap, CurrentLocation); - break; - } - case ConsoleKey.K: - if (CurrentGuid.Equals(Guid.Empty)) - throw new ApplicationException("Generate a new Guid using F4"); - SetItem(new Key(CurrentGuid)); - break; - } - } - - /// - /// ProcessMonsterModeCommands - /// - /// The input - static void ProcessMonsterModeCommands(ConsoleKeyInfo input) - { - switch (input.Key) - { - case ConsoleKey.Insert: - { - DisplayRegion tmpDisplayRegion = new DisplayRegion(0, 0, 0, 0); - Monster mSelected = null; - - int maxLen = 0; - int maxListLen = 0; - int maxListCount = 0; - - //storage for intermediate, modifiable string. - string strCat = string.Empty; - - // Read the console key, prior to entering while loop. - var k = Console.ReadKey(true); - - // When enter is not pressed keep collecting keychars. - while (k.Key != ConsoleKey.Enter) - { - string tmpPadding = string.Empty; - for (int c = 0; c < maxListLen; ++c) - tmpPadding += " "; - for (int ix = 1; ix <= maxListCount + 1; ++ix) - { - UI.Graphics.CursorToLocation(1, ix); - Console.Write(tmpPadding); - } - - if (char.IsLetter(k.KeyChar) || k.KeyChar.Equals(' ')) - { - strCat += k.KeyChar; - - // find an intermediate list of monsters that meet the selection criteria. - var tmpList = Monsters.Where( - x => x.Name.Contains(strCat)); - - int index = 2; - if (tmpList.Count() > 0) - { - if (tmpList.Count() > maxListCount) - maxListCount = tmpList.Count(); - - // Index through tmp list, maintain index for position. - foreach (var m in tmpList) - { - if (index == 2) mSelected = m; - - /// bring the cursor to the next menu place down, then write the - /// monsters level and monsters name separated by :: - string tmpListing = string.Format( - "{0}. {1} :: {2}", index - 1, m.Level, m.Name); - if (tmpListing.Length > maxListLen) - maxListLen = tmpListing.Length; - - UI.Graphics.CursorToLocation(1, index); - Console.Write(tmpListing); - - // increment index, for next line. - index++; - } - } - } - else - { - if (k.Key == ConsoleKey.Backspace) - { - if (strCat.Length > 0) - strCat = strCat.Remove(strCat.Length - 1); - } - else if (k.Key == ConsoleKey.Escape) - return; - } - - // record the maximal length. - if (strCat.Length > maxLen) - maxLen = strCat.Length; - - string tmpPaddingOuter = string.Empty; - UI.Graphics.CursorToLocation(1, 1); - for (int c = 0; c < maxLen; ++c) - tmpPaddingOuter += " "; - Console.Write(tmpPaddingOuter); - - UI.Graphics.CursorToLocation(1, 1); - Console.Write(strCat); - - Console.Write(maxListCount); - - k = Console.ReadKey(); - } - - // Update the second point of the region to include maximal values. - tmpDisplayRegion.P2 = new Location2i(maxListLen + 1, maxListCount + 2); - - // Refresh the buffered region where all our olde junk is. - CurrentMap.DungeonRenderer.RefreshBufferedRegion(CurrentLocation, - tmpDisplayRegion); - - // spawn the top monster on the list when the user pressed enter. - // this needs to be a copy, otherwise the single reference is retained throughout. - if (mSelected != null) - SetMonster(Util.DeepCopy(mSelected)); - - // hold on a second. - Thread.Sleep(100); - } - break; - case ConsoleKey.S: - ShopKeeper shopKeeper = new GulDarTheShopKeeper(CurrentLocation); - shopKeeper.Brain = new Game.NPC.AI.Brain(shopKeeper, CurrentMap); - CurrentMap.NonPlayerControlled.Add(shopKeeper); - - break; - case ConsoleKey.N: - UI.Graphics.CursorToLocation(1, 1); - Console.WriteLine("Create Monster"); - Thread.Sleep(100); - Monster tmpNewMonster = new Monster() - { - Name = Input.GetString("Name"), - Stats = Input.ReadStats(), - G = Input.GetChar("Glyph: "), - C = Input.GetColour(), - }; - - #region Preview Monster - // Quick display of the monster just created. - var saveColour = Colour.CurrentColour; - UI.Graphics.CursorToLocation(1, 1); - Console.Write("Created Monster: "); - tmpNewMonster.C.Set(); - Console.Write(tmpNewMonster.G); - saveColour.Set(); - Thread.Sleep(100); - #endregion - - // assert that monster list exists. - if (Monsters == null) - Monsters = new List(); - - #region Make sure the monster has not already been created. - var mExists = Monsters.Where( - x => x.Name.Equals(tmpNewMonster.Name, StringComparison.OrdinalIgnoreCase)); - if (mExists.Count() > 0) - throw new DNHackException( - string.Format("The monster \"{0}\" already exists in the beastiary!", tmpNewMonster.Name)); - #endregion - - Monsters.Add(tmpNewMonster); - Monsters.Write(R.MonsterFile); - break; - } - } - } -} diff --git a/src/DotNetHack.Editor/EditorMode.cs b/src/DotNetHack.Editor/EditorMode.cs deleted file mode 100644 index 79bb905..0000000 --- a/src/DotNetHack.Editor/EditorMode.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Editor -{ - /// - /// The various editor modes that can be switched between. - /// - public enum EditorMode - { - Layout, - Items, - Monsters, - } -} diff --git a/src/DotNetHack.Editor/Help.cs b/src/DotNetHack.Editor/Help.cs deleted file mode 100644 index a157845..0000000 --- a/src/DotNetHack.Editor/Help.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; - -namespace DotNetHack.Editor -{ - /// - /// Help - /// - public class Help - { - /// - /// Show help - /// - public static void Show() - { - // Clear the screen, show a bounding box - UI.Graphics.Clear(Colour.Ocean); - UI.Graphics.Display.Box(5, 5, 10, 10); - Colour.DeepOcean.Set(); - ShowHelpLine("PageUp", "Move up a dungeon"); - ShowHelpLine("PageDown", "Move up a dungeon"); - } - - /// - /// ShowHelpLine - /// - /// - /// - private static void ShowHelpLine(string key, string desc) - { - Console.Write("\t{0}", key); - Console.Write(" - "); - Console.WriteLine("{0}", desc); - } - } -} \ No newline at end of file diff --git a/src/DotNetHack.Editor/Properties/AssemblyInfo.cs b/src/DotNetHack.Editor/Properties/AssemblyInfo.cs deleted file mode 100644 index a8eb70c..0000000 --- a/src/DotNetHack.Editor/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DotNetHack.Editor")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("DotNetHack.Editor")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("69b987fe-5c95-460d-9b0e-c47434080dfc")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DotNetHack.Editor/TileBuilder.cs b/src/DotNetHack.Editor/TileBuilder.cs deleted file mode 100644 index 67a3dd6..0000000 --- a/src/DotNetHack.Editor/TileBuilder.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Dungeon -{ - - /// - /// - /// - public static class TileBuilder - { - - } -} diff --git a/src/DotNetHack.GameEngine/AssemblyInfo.cs b/src/DotNetHack.GameEngine/AssemblyInfo.cs new file mode 100644 index 0000000..b135996 --- /dev/null +++ b/src/DotNetHack.GameEngine/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DotNetHack.Engine")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("PJensen")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/DotNetHack.GameEngine/DotNetHack.Engine.csproj b/src/DotNetHack.GameEngine/DotNetHack.Engine.csproj new file mode 100644 index 0000000..d8fd5bf --- /dev/null +++ b/src/DotNetHack.GameEngine/DotNetHack.Engine.csproj @@ -0,0 +1,76 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {5C263A08-247E-4454-9710-A16A521A6BA5} + Library + DotNetHack.GameEngine + DotNetHack.GameEngine + v4.5 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + + + none + true + bin\Release + prompt + 4 + false + false + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + + \ No newline at end of file diff --git a/src/DotNetHack.GameEngine/GameEngine.cs b/src/DotNetHack.GameEngine/GameEngine.cs new file mode 100644 index 0000000..7880d8b --- /dev/null +++ b/src/DotNetHack.GameEngine/GameEngine.cs @@ -0,0 +1,60 @@ +// +// GameEngine.cs +// +// Author: +// PJensen +// +// Copyright (c) 2012 Peter J. Jensen +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + +using System; + +namespace DotNetHack.Engine +{ + /// + /// Game engine. + /// + public class GameEngine : IDisposable + { + /// + /// Initializes a new instance of the class. + /// + public GameEngine(GameEngineFlags flags) + { + Flags = flags; + } + + /// + /// Gets or sets the flags. + /// + /// + /// The flags. + /// + public GameEngineFlags Flags { get; private set; } + + #region IDisposable implementation + + /// + /// + /// + public void Dispose() + { + + } + + #endregion + } +} + diff --git a/src/DotNetHack.GameEngine/GameEngineFlags.cs b/src/DotNetHack.GameEngine/GameEngineFlags.cs new file mode 100644 index 0000000..f93e7b7 --- /dev/null +++ b/src/DotNetHack.GameEngine/GameEngineFlags.cs @@ -0,0 +1,55 @@ +// +// GameEngineFlags.cs +// +// Author: +// PJensen +// +// Copyright (c) 2012 Peter J. Jensen +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + +namespace DotNetHack.Engine +{ + /// + /// Game engine flags. + /// + public enum GameEngineFlags + { + /// + /// The none flag. + /// + Default, + + /// + /// The debug flag. + /// + Debug, + + /// + /// The editor flag. + /// + Editor, + + /// + /// The god mode. + /// + GodMode, + + /// + /// The no clip. + /// + NoClip, + } +} + diff --git a/src/DotNetHack.GameEngine/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/DotNetHack.GameEngine/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..f969e76 Binary files /dev/null and b/src/DotNetHack.GameEngine/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.Engine.csproj.FileListAbsolute.txt b/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.Engine.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..6f2c9ea --- /dev/null +++ b/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.Engine.csproj.FileListAbsolute.txt @@ -0,0 +1,4 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.GameEngine\bin\Debug\DotNetHack.GameEngine.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.GameEngine\bin\Debug\DotNetHack.GameEngine.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.GameEngine\obj\Debug\DotNetHack.GameEngine.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.GameEngine\obj\Debug\DotNetHack.GameEngine.pdb diff --git a/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.GameEngine.dll b/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.GameEngine.dll new file mode 100644 index 0000000..d16217c Binary files /dev/null and b/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.GameEngine.dll differ diff --git a/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.GameEngine.pdb b/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.GameEngine.pdb new file mode 100644 index 0000000..01afba5 Binary files /dev/null and b/src/DotNetHack.GameEngine/obj/Debug/DotNetHack.GameEngine.pdb differ diff --git a/xml/potions/shadow.xml b/src/DotNetHack.GameEngine/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from xml/potions/shadow.xml rename to src/DotNetHack.GameEngine/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/xml/spells/arcane.xml b/src/DotNetHack.GameEngine/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs similarity index 100% rename from xml/spells/arcane.xml rename to src/DotNetHack.GameEngine/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs diff --git a/xml/spells/disease.xml b/src/DotNetHack.GameEngine/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs similarity index 100% rename from xml/spells/disease.xml rename to src/DotNetHack.GameEngine/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs diff --git a/src/DotNetHack.Serialization/AssemblyInfo.cs b/src/DotNetHack.Serialization/AssemblyInfo.cs new file mode 100644 index 0000000..4de2cf8 --- /dev/null +++ b/src/DotNetHack.Serialization/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DotNetHack.Serialization")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("pjensen")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/DotNetHack.Serialization/DotNetHack.Serialization.csproj b/src/DotNetHack.Serialization/DotNetHack.Serialization.csproj new file mode 100644 index 0000000..103ad27 --- /dev/null +++ b/src/DotNetHack.Serialization/DotNetHack.Serialization.csproj @@ -0,0 +1,74 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3} + Library + DotNetHack.Serialization + DotNetHack.Serialization + v4.5 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + + + none + true + bin\Release + prompt + 4 + false + false + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + + \ No newline at end of file diff --git a/src/DotNetHack.Serialization/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/DotNetHack.Serialization/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..ed3ad1e Binary files /dev/null and b/src/DotNetHack.Serialization/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.csproj.FileListAbsolute.txt b/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..fc20353 --- /dev/null +++ b/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.csproj.FileListAbsolute.txt @@ -0,0 +1,4 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Serialization\bin\Debug\DotNetHack.Serialization.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Serialization\bin\Debug\DotNetHack.Serialization.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Serialization\obj\Debug\DotNetHack.Serialization.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack.Serialization\obj\Debug\DotNetHack.Serialization.pdb diff --git a/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.dll b/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.dll new file mode 100644 index 0000000..e9bc20d Binary files /dev/null and b/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.dll differ diff --git a/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.pdb b/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.pdb new file mode 100644 index 0000000..417ec74 Binary files /dev/null and b/src/DotNetHack.Serialization/obj/Debug/DotNetHack.Serialization.pdb differ diff --git a/xml/spells/frost.xml b/src/DotNetHack.Serialization/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from xml/spells/frost.xml rename to src/DotNetHack.Serialization/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/xml/spells/holy.xml b/src/DotNetHack.Serialization/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs similarity index 100% rename from xml/spells/holy.xml rename to src/DotNetHack.Serialization/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs diff --git a/xml/spells/nature.xml b/src/DotNetHack.Serialization/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs similarity index 100% rename from xml/spells/nature.xml rename to src/DotNetHack.Serialization/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs diff --git a/src/DotNetHack.sln b/src/DotNetHack.sln index c9cce22..b7411a9 100644 --- a/src/DotNetHack.sln +++ b/src/DotNetHack.sln @@ -1,26 +1,346 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack", "DotNetHack\DotNetHack.csproj", "{0C36C4DD-060F-4E4F-A0A3-EFF2B8FD33BA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.Editor", "DotNetHack.Editor\DotNetHack.Editor.csproj", "{666F5001-AC74-4160-862A-3D5B79D23A65}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0C36C4DD-060F-4E4F-A0A3-EFF2B8FD33BA}.Debug|x86.ActiveCfg = Debug|x86 - {0C36C4DD-060F-4E4F-A0A3-EFF2B8FD33BA}.Debug|x86.Build.0 = Debug|x86 - {0C36C4DD-060F-4E4F-A0A3-EFF2B8FD33BA}.Release|x86.ActiveCfg = Release|x86 - {0C36C4DD-060F-4E4F-A0A3-EFF2B8FD33BA}.Release|x86.Build.0 = Release|x86 - {666F5001-AC74-4160-862A-3D5B79D23A65}.Debug|x86.ActiveCfg = Debug|x86 - {666F5001-AC74-4160-862A-3D5B79D23A65}.Debug|x86.Build.0 = Debug|x86 - {666F5001-AC74-4160-862A-3D5B79D23A65}.Release|x86.ActiveCfg = Release|x86 - {666F5001-AC74-4160-862A-3D5B79D23A65}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{3B9C617D-F680-4713-BCB2-E80FA7B0B881}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{82488C48-CB3F-4D6F-8C25-6921000B286B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.Core", "DotNetHack.Core\DotNetHack.Core.csproj", "{2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.Engine", "DotNetHack.GameEngine\DotNetHack.Engine.csproj", "{5C263A08-247E-4454-9710-A16A521A6BA5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.Data", "DotNetHack.Data\DotNetHack.Data.csproj", "{BE13084A-561B-4B51-B546-68D662D64AF3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.Serialization", "DotNetHack.Serialization\DotNetHack.Serialization.csproj", "{106C5C8B-952D-4507-8E1C-8FDB981B8FB3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.AI", "DotNetHack.AI\DotNetHack.AI.csproj", "{157A18FF-68CD-4C29-8F16-B0B85FBC13BA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.Plugin", "Plugins\DotNetHack.Plugin\DotNetHack.Plugin.csproj", "{EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack.Server", "Server\DotNetHack.Server\DotNetHack.Server.csproj", "{CF2A5A92-69F8-4527-A573-EE10D612B697}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetHack", "DotNetHack\DotNetHack.csproj", "{75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Default|Any CPU = Default|Any CPU + Default|Mixed Platforms = Default|Mixed Platforms + Default|x86 = Default|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Debug|x86.ActiveCfg = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Debug|x86.Build.0 = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Default|Any CPU.ActiveCfg = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Default|Any CPU.Build.0 = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Default|Mixed Platforms.Build.0 = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Default|x86.ActiveCfg = Debug|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Release|Any CPU.Build.0 = Release|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Release|x86.ActiveCfg = Release|Any CPU + {2B06942B-EA7A-4FE7-ABDF-B57544C31CA1}.Release|x86.Build.0 = Release|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Debug|x86.ActiveCfg = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Debug|x86.Build.0 = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Default|Any CPU.ActiveCfg = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Default|Any CPU.Build.0 = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Default|Mixed Platforms.Build.0 = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Default|x86.ActiveCfg = Debug|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Release|Any CPU.Build.0 = Release|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Release|x86.ActiveCfg = Release|Any CPU + {5C263A08-247E-4454-9710-A16A521A6BA5}.Release|x86.Build.0 = Release|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Debug|x86.ActiveCfg = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Debug|x86.Build.0 = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Default|Any CPU.ActiveCfg = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Default|Any CPU.Build.0 = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Default|Mixed Platforms.Build.0 = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Default|x86.ActiveCfg = Debug|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Release|Any CPU.Build.0 = Release|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Release|x86.ActiveCfg = Release|Any CPU + {BE13084A-561B-4B51-B546-68D662D64AF3}.Release|x86.Build.0 = Release|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Debug|x86.ActiveCfg = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Debug|x86.Build.0 = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Default|Any CPU.ActiveCfg = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Default|Any CPU.Build.0 = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Default|Mixed Platforms.Build.0 = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Default|x86.ActiveCfg = Debug|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Release|Any CPU.Build.0 = Release|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Release|x86.ActiveCfg = Release|Any CPU + {106C5C8B-952D-4507-8E1C-8FDB981B8FB3}.Release|x86.Build.0 = Release|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Debug|x86.ActiveCfg = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Debug|x86.Build.0 = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Default|Any CPU.ActiveCfg = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Default|Any CPU.Build.0 = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Default|Mixed Platforms.Build.0 = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Default|x86.ActiveCfg = Debug|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Release|Any CPU.Build.0 = Release|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Release|x86.ActiveCfg = Release|Any CPU + {157A18FF-68CD-4C29-8F16-B0B85FBC13BA}.Release|x86.Build.0 = Release|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Debug|x86.ActiveCfg = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Debug|x86.Build.0 = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Default|Any CPU.ActiveCfg = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Default|Any CPU.Build.0 = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Default|Mixed Platforms.Build.0 = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Default|x86.ActiveCfg = Debug|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Release|Any CPU.Build.0 = Release|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Release|x86.ActiveCfg = Release|Any CPU + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A}.Release|x86.Build.0 = Release|Any CPU + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Debug|Any CPU.ActiveCfg = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Debug|x86.ActiveCfg = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Debug|x86.Build.0 = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Default|Any CPU.ActiveCfg = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Default|Mixed Platforms.ActiveCfg = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Default|Mixed Platforms.Build.0 = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Default|x86.ActiveCfg = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Default|x86.Build.0 = Debug|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Release|Any CPU.ActiveCfg = Release|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Release|Mixed Platforms.Build.0 = Release|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Release|x86.ActiveCfg = Release|x86 + {CF2A5A92-69F8-4527-A573-EE10D612B697}.Release|x86.Build.0 = Release|x86 + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Debug|x86.ActiveCfg = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Default|Any CPU.ActiveCfg = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Default|Any CPU.Build.0 = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Default|Mixed Platforms.Build.0 = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Default|x86.ActiveCfg = Debug|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Release|Any CPU.Build.0 = Release|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A} = {3B9C617D-F680-4713-BCB2-E80FA7B0B881} + {CF2A5A92-69F8-4527-A573-EE10D612B697} = {82488C48-CB3F-4D6F-8C25-6921000B286B} + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + StartupItem = DotNetHack.Core\DotNetHack.Core.csproj + Policies = $0 + $0.TextStylePolicy = $3 + $1.inheritsSet = VisualStudio + $1.inheritsScope = text/plain + $1.scope = text/x-csharp + $0.CSharpFormattingPolicy = $2 + $2.IndentSwitchBody = True + $2.AnonymousMethodBraceStyle = NextLine + $2.PropertyBraceStyle = NextLine + $2.PropertyGetBraceStyle = NextLine + $2.PropertySetBraceStyle = NextLine + $2.EventBraceStyle = NextLine + $2.EventAddBraceStyle = NextLine + $2.EventRemoveBraceStyle = NextLine + $2.StatementBraceStyle = NextLine + $2.ElseNewLinePlacement = NewLine + $2.ElseIfNewLinePlacement = SameLine + $2.CatchNewLinePlacement = NewLine + $2.FinallyNewLinePlacement = NewLine + $2.ArrayInitializerBraceStyle = NextLine + $2.BeforeMethodDeclarationParentheses = False + $2.BeforeMethodCallParentheses = False + $2.BeforeConstructorDeclarationParentheses = False + $2.BeforeDelegateDeclarationParentheses = False + $2.NewParentheses = False + $2.inheritsSet = Mono + $2.inheritsScope = text/x-csharp + $2.scope = text/x-csharp + $3.FileWidth = 120 + $3.inheritsSet = VisualStudio + $3.inheritsScope = text/plain + $3.scope = text/plain + $0.StandardHeader = $4 + $4.Text = @\n ${FileName}\n \n Author:\n ${AuthorName} <${AuthorEmail}>\n \n Copyright (c) ${Year} ${CopyrightHolder}\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with this program. If not, see . + $4.IncludeInNewFiles = True + $0.NameConventionPolicy = $5 + $5.Rules = $6 + $6.NamingRule = $31 + $7.Name = Namespaces + $7.AffectedEntity = Namespace + $7.VisibilityMask = VisibilityMask + $7.NamingStyle = PascalCase + $7.IncludeInstanceMembers = True + $7.IncludeStaticEntities = True + $8.Name = Types + $8.AffectedEntity = Class, Struct, Enum, Delegate + $8.VisibilityMask = VisibilityMask + $8.NamingStyle = PascalCase + $8.IncludeInstanceMembers = True + $8.IncludeStaticEntities = True + $9.Name = Interfaces + $9.RequiredPrefixes = $10 + $10.String = I + $9.AffectedEntity = Interface + $9.VisibilityMask = VisibilityMask + $9.NamingStyle = PascalCase + $9.IncludeInstanceMembers = True + $9.IncludeStaticEntities = True + $11.Name = Attributes + $11.RequiredSuffixes = $12 + $12.String = Attribute + $11.AffectedEntity = CustomAttributes + $11.VisibilityMask = VisibilityMask + $11.NamingStyle = PascalCase + $11.IncludeInstanceMembers = True + $11.IncludeStaticEntities = True + $13.Name = Event Arguments + $13.RequiredSuffixes = $14 + $14.String = EventArgs + $13.AffectedEntity = CustomEventArgs + $13.VisibilityMask = VisibilityMask + $13.NamingStyle = PascalCase + $13.IncludeInstanceMembers = True + $13.IncludeStaticEntities = True + $15.Name = Exceptions + $15.RequiredSuffixes = $16 + $16.String = Exception + $15.AffectedEntity = CustomExceptions + $15.VisibilityMask = VisibilityMask + $15.NamingStyle = PascalCase + $15.IncludeInstanceMembers = True + $15.IncludeStaticEntities = True + $17.Name = Methods + $17.AffectedEntity = Methods + $17.VisibilityMask = VisibilityMask + $17.NamingStyle = PascalCase + $17.IncludeInstanceMembers = True + $17.IncludeStaticEntities = True + $18.Name = Static Readonly Fields + $18.AffectedEntity = ReadonlyField + $18.VisibilityMask = Internal, Protected, Public + $18.NamingStyle = PascalCase + $18.IncludeInstanceMembers = False + $18.IncludeStaticEntities = True + $19.Name = Fields (Non Private) + $19.AffectedEntity = Field + $19.VisibilityMask = Internal, Protected, Public + $19.NamingStyle = PascalCase + $19.IncludeInstanceMembers = True + $19.IncludeStaticEntities = True + $20.Name = ReadOnly Fields (Non Private) + $20.AffectedEntity = ReadonlyField + $20.VisibilityMask = Internal, Protected, Public + $20.NamingStyle = PascalCase + $20.IncludeInstanceMembers = True + $20.IncludeStaticEntities = False + $21.Name = Fields (Private) + $21.AllowedPrefixes = $22 + $22.String = m_ + $21.AffectedEntity = Field, ReadonlyField + $21.VisibilityMask = Private + $21.NamingStyle = CamelCase + $21.IncludeInstanceMembers = True + $21.IncludeStaticEntities = False + $23.Name = Static Fields (Private) + $23.AffectedEntity = Field + $23.VisibilityMask = Private + $23.NamingStyle = CamelCase + $23.IncludeInstanceMembers = False + $23.IncludeStaticEntities = True + $24.Name = ReadOnly Fields (Private) + $24.AllowedPrefixes = $25 + $25.String = m_ + $24.AffectedEntity = ReadonlyField + $24.VisibilityMask = Private + $24.NamingStyle = CamelCase + $24.IncludeInstanceMembers = True + $24.IncludeStaticEntities = False + $26.Name = Constant Fields + $26.AffectedEntity = ConstantField + $26.VisibilityMask = VisibilityMask + $26.NamingStyle = PascalCase + $26.IncludeInstanceMembers = True + $26.IncludeStaticEntities = True + $27.Name = Properties + $27.AffectedEntity = Property + $27.VisibilityMask = VisibilityMask + $27.NamingStyle = PascalCase + $27.IncludeInstanceMembers = True + $27.IncludeStaticEntities = True + $28.Name = Events + $28.AffectedEntity = Event + $28.VisibilityMask = VisibilityMask + $28.NamingStyle = PascalCase + $28.IncludeInstanceMembers = True + $28.IncludeStaticEntities = True + $29.Name = Enum Members + $29.AffectedEntity = EnumMember + $29.VisibilityMask = VisibilityMask + $29.NamingStyle = PascalCase + $29.IncludeInstanceMembers = True + $29.IncludeStaticEntities = True + $30.Name = Parameters + $30.AffectedEntity = Parameter + $30.VisibilityMask = VisibilityMask + $30.NamingStyle = CamelCase + $30.IncludeInstanceMembers = True + $30.IncludeStaticEntities = True + $31.Name = Type Parameters + $31.RequiredPrefixes = $32 + $32.String = T + $31.AffectedEntity = TypeParameter + $31.VisibilityMask = VisibilityMask + $31.NamingStyle = PascalCase + $31.IncludeInstanceMembers = True + $31.IncludeStaticEntities = True + EndGlobalSection +EndGlobal diff --git a/src/DotNetHack/App.config b/src/DotNetHack/App.config new file mode 100644 index 0000000..fad249e --- /dev/null +++ b/src/DotNetHack/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/DotNetHack/DNHackException.cs b/src/DotNetHack/DNHackException.cs deleted file mode 100644 index a3b25bc..0000000 --- a/src/DotNetHack/DNHackException.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack -{ - /// - /// DNHackException - /// - public class DNHackException : Exception - { - /// - /// DNHackException - /// - /// Exception message - /// Inner exception - public DNHackException(string aMessage, Exception aInner) - : base(aMessage, aInner) { } - - /// - /// DNHackException - /// - /// Exception message - public DNHackException(string aMessage) - : this(aMessage, null) { } - } -} diff --git a/src/DotNetHack/Disposition.cs b/src/DotNetHack/Disposition.cs deleted file mode 100644 index c188cc5..0000000 --- a/src/DotNetHack/Disposition.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack -{ - public enum Disposition - { - Friendly, - Neutral, - Hostile, - } -} diff --git a/src/DotNetHack/DotNetHack.csproj b/src/DotNetHack/DotNetHack.csproj index 14b1cba..147418c 100644 --- a/src/DotNetHack/DotNetHack.csproj +++ b/src/DotNetHack/DotNetHack.csproj @@ -1,232 +1,80 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {0C36C4DD-060F-4E4F-A0A3-EFF2B8FD33BA} - Exe - Properties - DotNetHack - DotNetHack - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - true - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\lib\NAudio.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + {75963D0E-0C15-4F0A-ADF5-2D5F0B24C694} + Exe + Properties + DotNetHack + DotNetHack + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {157a18ff-68cd-4c29-8f16-b0b85fbc13ba} + DotNetHack.AI + + + {2b06942b-ea7a-4fe7-abdf-b57544c31ca1} + DotNetHack.Core + + + {5c263a08-247e-4454-9710-a16a521a6ba5} + DotNetHack.Engine + + + {106c5c8b-952d-4507-8e1c-8fdb981b8fb3} + DotNetHack.Serialization + + + {ea25aaa4-507f-4cfa-ab6d-abc7f59d941a} + DotNetHack.Plugin + + + + \ No newline at end of file diff --git a/src/DotNetHack/EntryPoint.cs b/src/DotNetHack/EntryPoint.cs index 80cb06f..be7b4d9 100644 --- a/src/DotNetHack/EntryPoint.cs +++ b/src/DotNetHack/EntryPoint.cs @@ -1,43 +1,107 @@ +// EntryPoint.cs +// +// Author: +// PJensen +// +// Copyright (c) 2012 Peter J. Jensen +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . using System; -using DotNetHack.Game; -using DotNetHack.Game.Dungeon; namespace DotNetHack { - /// - /// EntryPoint - /// + using Engine; + class EntryPoint { /// - /// Main + /// The entry point of the program, where the program control starts and ends. /// - /// - /// A + /// + /// The command-line arguments. /// public static void Main(string[] args) { - // Parse runtime arguments - R.ParseArgs(args); + GameEngineFlags flags = GameEngineFlags.Default; + + if (!ParseArgs(args, ref flags)) + { + throw new ArgumentException("Invalid arguments"); + } - // Initialize graphics - UI.Graphics.Initialize(); + Console.WriteLine("User Name: "); + string userName = Console.ReadLine(); + Console.WriteLine("Password: "); + string password = Console.ReadLine(); + + // Note: This setup will change - Dungeon3 d = new Dungeon3(UI.Graphics.ScreenWidth, - UI.Graphics.ScreenHeight, 10); - - // Create a new game engine - GameEngine g = new GameEngine(new Player("pete"), d); + using (GameEngine ge = new GameEngine(flags)) + { + + } + } + + /// + /// Parses the arguments. + /// + /// + /// The arguments. + /// + /// + /// If set to true argv. + /// + /// + /// If set to true flags. + /// + public static bool ParseArgs(string[] argv, ref GameEngineFlags flags) + { + for (int index = 0; index < argv.Length; ++index) + { + var arg = argv [index]; - // Run - GameEngine.EngineRunFlags runFlags = - GameEngine.EngineRunFlags.Normal; + if ("-debug".Equals(arg)) + { + flags |= GameEngineFlags.Debug; + } + else if ("-editor".Equals(arg)) + { + flags |= GameEngineFlags.Editor; + } + else if ("--no-clip".Equals(arg)) + { + flags |= GameEngineFlags.NoClip; + } + else if ("--iddqd".Equals(arg)) + { + flags |= GameEngineFlags.GodMode; + } - // If runtime is setup for debug, set the run flags - if (R.IsDebug) - runFlags |= GameEngine.EngineRunFlags.Debug; + if (index + 1 < argv.Length) + { + var next_arg = argv [index + 1]; - g.Run(runFlags, ref args); + if (next_arg != null) + { + // Note: Args that require a second parameter + // (e.g.) --set-to 5 are set here. + } + } + } + + return true; } + } -} \ No newline at end of file +} diff --git a/src/DotNetHack/Game/Actions/Attack.cs b/src/DotNetHack/Game/Actions/Attack.cs deleted file mode 100644 index cbc3a26..0000000 --- a/src/DotNetHack/Game/Actions/Attack.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Effects; - -namespace DotNetHack.Game.Actions -{ - /// - /// An action. - /// - public abstract class DAction - { - /// - /// performs the action, returns boolean result. - /// - /// - public abstract bool Perform(); - } - - public abstract class DAction - { - public abstract bool Perform(T on); - } - - /// - /// ActionAttack - /// - public abstract class ActionAttack : DAction - { - /// - /// Creates a new attack action to be performed. - /// - /// The attacker - /// The defender - public ActionAttack(Actor aAttacker, Actor aDefender) - { - Attacker = aAttacker; - Defender = aDefender; - } - - /// - /// The attacker involved in this attack action. - /// - protected Actor Attacker { get; set; } - - /// - /// The defender involved in this attack action. - /// - protected Actor Defender { get; set; } - - /// - /// The ActOn function for ActionAttack takes two actors, - /// and returns a boolean. - /// LHS - Attacker, RHS - Defender - /// - protected Func ActOn { get; set; } - - /// - /// Performs the attack action, and returns the success boolean. - /// - public override bool Perform() - { - if (ActOn != null) - return ActOn(Attacker, Defender); - return false; - } - } - - /// - /// ActionMeleeAttack - /// - public class ActionMeleeAttack : ActionAttack - { - public ActionMeleeAttack(Actor aAttacker, Actor aDefender) - : base(aAttacker, aDefender) - { - ActOn = MeleeAttack; - } - - static bool MeleeAttack(Actor aAttacker, Actor aDefender) - { - if (aAttacker.WieldedWeapons.CurrentWeapon == null) - return false; - - // this junk should be rollec up into a game-engine delegate - // http://www.uesp.net/wiki/Oblivion:The_Complete_Damage_Formula - double weaponRating = - aAttacker.WieldedWeapons.CurrentWeapon.WeaponProperties.BaseWeaponDamage - * 0.5 * (aAttacker.WieldedWeapons.CurrentWeapon.WeaponProperties.Condition - / aAttacker.WieldedWeapons.CurrentWeapon.WeaponProperties.MaxCondition + 1) - / 2; - - aDefender.Stats.Health -= (int)weaponRating; - - return true; - } - } -} diff --git a/src/DotNetHack/Game/Actions/Move.cs b/src/DotNetHack/Game/Actions/Move.cs deleted file mode 100644 index 9320356..0000000 --- a/src/DotNetHack/Game/Actions/Move.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Actions -{ - /// - /// Move - /// - public class Move : DAction - { - /// - /// Move - /// - /// Actor - /// From - /// To - public Move(Actor aActor, Location3i aFrom, Location3i aTo) { } - - /// - /// Perform the Action - /// - /// - public override bool Perform() - { - return false; - } - } -} diff --git a/src/DotNetHack/Game/Actions/Pickup.cs b/src/DotNetHack/Game/Actions/Pickup.cs deleted file mode 100644 index 70644f9..0000000 --- a/src/DotNetHack/Game/Actions/Pickup.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game.Actions -{ - - public class ActionPickup : DAction - { - public ActionPickup(Actor actor, ItemCollection itemCollection) - : base() - { - ActorInvolved = actor; - ItemCollectionInvolved = itemCollection; - } - - public override bool Perform() - { - - if (ItemCollectionInvolved.Count > 0) - { - var item = ItemCollectionInvolved.Pop(); - ActorInvolved.Inventory.Add(item); - return true; - } return false; - } - - Actor ActorInvolved { get; set; } - - ItemCollection ItemCollectionInvolved { get; set; } - } -} diff --git a/src/DotNetHack/Game/Actions/PutOn.cs b/src/DotNetHack/Game/Actions/PutOn.cs deleted file mode 100644 index 7579cfc..0000000 --- a/src/DotNetHack/Game/Actions/PutOn.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Actions -{ - class PutOn - { - } -} diff --git a/src/DotNetHack/Game/Actions/Quaff.cs b/src/DotNetHack/Game/Actions/Quaff.cs deleted file mode 100644 index ed086fc..0000000 --- a/src/DotNetHack/Game/Actions/Quaff.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Actions -{ -} diff --git a/src/DotNetHack/Game/Actions/Wield.cs b/src/DotNetHack/Game/Actions/Wield.cs deleted file mode 100644 index 811e5c1..0000000 --- a/src/DotNetHack/Game/Actions/Wield.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Actions -{ - class Wield - { - } -} diff --git a/src/DotNetHack/Game/Actor.cs b/src/DotNetHack/Game/Actor.cs deleted file mode 100644 index 84f7f8a..0000000 --- a/src/DotNetHack/Game/Actor.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Events; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items; -using DotNetHack.Game.Effects; -using System.Xml.Serialization; -using DotNetHack.Game.Items.Equipment.Armour; -using DotNetHack.Game.Items.Equipment.Weapons; - -namespace DotNetHack.Game -{ - /// - /// Actor - /// - [Serializable] - public abstract class Actor : IDrawable, ICanBeEffected - { - /// - /// Create a new instance of Actor. - /// - public Actor() - { - // Create inventory collection for this actor. - Inventory = new ItemCollection(); - - // Active effects on this actor. - EffectStack = new List(); - - // The actors stats. - Stats = new Stats(); - - WieldedWeapons = new WeaponsWielded(); - } - - /// - /// Creates a new instance of with the specified glyph - /// and colour. - /// - public Actor(string aName, char aGlyph, Colour aColor, Location3i aLocation) - : this() - { - Location = aLocation; - Name = aName; - G = aGlyph; - C = aColor; - } - - /// - /// Location - /// - [XmlIgnore] - public Location3i Location { get; set; } - - /// - /// The name of this actor. - /// - [XmlAttribute] - public string Name { get; set; } - - /// - /// Stats for this Actor - /// - public Stats Stats { get; set; } - - /// - /// All actors have inventory. - /// - [XmlIgnore] - public ItemCollection Inventory { get; set; } - - /// - /// EffectStack - /// - [XmlIgnore] - public List EffectStack { get; set; } - - /// - /// ApplyEffects - /// - public void ApplyEffects() - { - // tick everything in the effect stack. - foreach (var effect in EffectStack) - effect.Tick(this); - - // remove all depleated effects that are not perament. - EffectStack.RemoveAll(e => e.Duration <= 0 && e.Duration != Effect.PermanentDuration); - } - - /// - /// The glyph representing this actor. - /// - public virtual char G { get; set; } - - /// - /// The colour of this actors - /// - public virtual Colour C { get; set; } - - /// - /// Draw this actor. - /// - public void Draw() { UI.Graphics.Draw(this); } - - /// - /// suplicant classes can add their own flavourings also. - /// this should be called after stats have been created. - /// - public virtual void Initialize() - { - Stats.Health = Stats.HitPoints; - Stats.Mana = 0; - WornArmour = new ArmourWorn(); - WieldedWeapons = new WeaponsWielded(); - } - - public bool Dead { get; set; } - - /// - /// RegenerateMagika - /// - public virtual void RegenerateMagika() - { - StatsBase b = WornArmour.CommutedStats(a => a.ArmourStats.Condition > 0); - - if (++MagikaRegenTicks > (100 - ((b.Intelligence + Stats.Intelligence) * 3))) - { - MagikaRegenTicks = 0; - Stats.Mana++; - } - } - - int HealthRegenTicks = 0; - int MagikaRegenTicks = 0; - - /// - /// RegenerateHealth - /// - public virtual void RegenerateHealth() - { - StatsBase b = WornArmour.CommutedStats(a => - a.ArmourStats.Condition > 0 && a.StatsBase.Endurance > 0); - - if (++HealthRegenTicks > (100 - ((b.Endurance + Stats.Endurance) * 2))) - { - HealthRegenTicks = 0; - Stats.Health++; - } - } - - /// - /// The armour that is worn by the player. - /// - [XmlIgnore] - public ArmourWorn WornArmour { get; set; } - - /// - /// the weapons currently being wielded (or sheathed) by the player. - /// - [XmlIgnore] - public WeaponsWielded WieldedWeapons { get; set; } - - - } -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Alchemy/Alchemy.cs b/src/DotNetHack/Game/Alchemy/Alchemy.cs deleted file mode 100644 index 911f1d2..0000000 --- a/src/DotNetHack/Game/Alchemy/Alchemy.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items.Herbs; -using DotNetHack.Game.Items.Equipment.Tools; - -namespace DotNetHack.Game -{ - -} diff --git a/src/DotNetHack/Game/Alchemy/Ingredient .cs b/src/DotNetHack/Game/Alchemy/Ingredient .cs deleted file mode 100644 index bd25261..0000000 --- a/src/DotNetHack/Game/Alchemy/Ingredient .cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game -{ - public class Ingredient - { - public string Name { get; set; } - public override bool Equals(object obj) { return ((Ingredient)obj).Name.Equals(Name); } - } -} diff --git a/src/DotNetHack/Game/Alchemy/Recipe.cs b/src/DotNetHack/Game/Alchemy/Recipe.cs deleted file mode 100644 index 9e3fe46..0000000 --- a/src/DotNetHack/Game/Alchemy/Recipe.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game -{ - /// - /// A recipe, is a collection of ingredients that when mixxed and stored - /// becomes a potion. - /// - public class Recipe - { - public Recipe(string aName, Ingredient[] aIn) - { - Ingredients = new List(); - foreach (var ix in aIn) { } - // Ingredients.Add(ix); - } - - /// - /// The name of this recipe - /// - public string Name { get; set; } - - /// - /// Yields - /// - public IPotion Potion { get; set; } - - /// - /// - /// - public List Ingredients { get; set; } - - /// - /// - /// - /// - /// - public bool HasRequiredIngredients(List iii) - { - foreach (var ix in iii) - if (!Ingredients.Contains(ix)) - return false; - return true; - } - } -} diff --git a/src/DotNetHack/Game/Colour.cs b/src/DotNetHack/Game/Colour.cs deleted file mode 100644 index c40f875..0000000 --- a/src/DotNetHack/Game/Colour.cs +++ /dev/null @@ -1,278 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Diagnostics; - -namespace DotNetHack.Game -{ - public static class ColourExtensions - { - public static void Set(this Colour c) - { - Console.ForegroundColor = c.FG; - Console.BackgroundColor = c.BG; - } - - public static ConsoleColor Negate(this ConsoleColor c) - { - switch (c) - { - default: - return ConsoleColor.White; - - case ConsoleColor.Gray: - return ConsoleColor.DarkGray; - - case ConsoleColor.DarkGray: - return ConsoleColor.Gray; - - case ConsoleColor.Black: - return ConsoleColor.White; - - case ConsoleColor.White: - return ConsoleColor.Black; - - case ConsoleColor.Yellow: - return ConsoleColor.Cyan; - - case ConsoleColor.Cyan: - return ConsoleColor.Yellow; - - case ConsoleColor.DarkCyan: - return ConsoleColor.DarkYellow; - - case ConsoleColor.DarkYellow: - return ConsoleColor.DarkCyan; - - case ConsoleColor.Green: - return ConsoleColor.Red; - - case ConsoleColor.Red: - return ConsoleColor.Green; - - case ConsoleColor.DarkMagenta: - return ConsoleColor.DarkYellow; - - case ConsoleColor.DarkBlue: - return ConsoleColor.DarkRed; - - case ConsoleColor.DarkRed: - return ConsoleColor.DarkBlue; - - case ConsoleColor.DarkGreen: - return ConsoleColor.DarkMagenta; - - case ConsoleColor.Magenta: - return ConsoleColor.DarkGreen; - } - } - } - - /// - /// Colour - /// - [Serializable, DebuggerDisplay("{ToString()}")] - public class Colour : IEquatable - { - public Colour() { } - public Colour(ConsoleColor aFG) - : this(aFG, ConsoleColor.Black) - { } - - public Colour(ConsoleColor aFG, ConsoleColor aBG) - { - FG = aFG; - BG = aBG; - } - - /// - /// Copy constructor. - /// - /// The colour to copy - public Colour(Colour colour) - { - BG = colour.BG; - FG = colour.FG; - } - - public void SetBG(ConsoleColor aBG) - { - BG = aBG; - } - - public void SetFG(ConsoleColor aFG) - { - FG = aFG; - } - - /// - /// ToString - /// - /// - public override string ToString() - { - return string.Format("({0},{1})", FG, BG); - } - - /// - /// Return a colour that is NOT this colour. - /// The inverse of the passed colour. - /// - /// - /// The inverse of the passed colour. - public static Colour operator !(Colour colour) - { - Colour retVal = new Colour(colour); - retVal.BG = retVal.BG.Negate(); - retVal.FG = retVal.FG.Negate(); - return retVal; - } - - public ConsoleColor FG; - - public ConsoleColor BG; - - public static Colour CurrentColour - { - get { return new Colour(Console.ForegroundColor, Console.BackgroundColor); } - } - - public static Colour Standard - { - get { return new Colour(ConsoleColor.Gray); } - } - - public static Colour DarkRed - { - get { return new Colour(ConsoleColor.DarkRed); } - } - - public static Colour Yellow - { - get { return new Colour(ConsoleColor.Yellow); } - } - - public static Colour Magenta - { - get { return new Colour(ConsoleColor.Magenta); } - } - - public static Colour DarkMagenta - { - get { return new Colour(ConsoleColor.DarkMagenta); } - } - - public static Colour Blue - { - get { return new Colour(ConsoleColor.Blue); } - } - - public static Colour Cyan - { - get { return new Colour(ConsoleColor.Cyan); } - } - - public static Colour DarkBlue - { - get { return new Colour(ConsoleColor.DarkBlue); } - } - - public static Colour DarkCyan - { - get { return new Colour(ConsoleColor.DarkCyan); } - } - - public static Colour DarkYellow - { - get { return new Colour(ConsoleColor.DarkYellow); } - } - - public static Colour Green - { - get { return new Colour(ConsoleColor.Green); } - } - - public static Colour DarkGreen - { - get { return new Colour(ConsoleColor.DarkGreen); } - } - - // TODO: Find the best color combination for copper and silver - public static Colour Silver - { - get { return new Colour(ConsoleColor.DarkGray); } - } - - public static Colour Copper - { - get { return new Colour(ConsoleColor.DarkRed); } - } - - public static Colour Void - { - get { return new Colour(ConsoleColor.Black); } - } - - public static Colour White - { - get { return new Colour(ConsoleColor.White); } - } - - public static Colour Ocean - { - get { return new Colour(ConsoleColor.White, ConsoleColor.Blue); } - } - - public static Colour Bridge - { - get { return new Colour(ConsoleColor.DarkRed, ConsoleColor.Blue); } - } - - public static Colour DeepOcean - { - get { return new Colour(ConsoleColor.White, ConsoleColor.DarkBlue); } - } - - public static Colour Mountain - { - get { return new Colour(ConsoleColor.Red, ConsoleColor.DarkRed); } - } - - public static Colour Grass - { - get { return new Colour(ConsoleColor.Green); } - } - - public static Colour Grave - { - get { return new Colour(ConsoleColor.Black, ConsoleColor.DarkGreen); } - } - - public static Colour Door - { - get { return new Colour(ConsoleColor.DarkYellow); } - } - - public static Colour Field - { - get { return new Colour(ConsoleColor.DarkYellow, ConsoleColor.Yellow); } - } - - public static Colour Road - { - get { return new Colour(ConsoleColor.DarkGreen, ConsoleColor.Black); } - } - - public static Colour Fountain - { - get { return new Colour(ConsoleColor.DarkBlue); } - } - - public bool Equals(Colour other) - { - return this.BG == other.BG && - this.FG == other.FG; - } - } -} diff --git a/src/DotNetHack/Game/Dice.cs b/src/DotNetHack/Game/Dice.cs deleted file mode 100644 index ee6e23c..0000000 --- a/src/DotNetHack/Game/Dice.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game -{ - /// - /// Though this class is titled Dice it merely deals with and handlesthe various requests - /// for randomness throughout. - /// - public static class Dice - { - /// - /// returns true for desired percent chance. - /// linear distribution? - /// - /// desired percent chance - /// true when condition is met. - public static bool D(double n) { return (R.Random.NextDouble() * 100 < n); } - - - - /// - /// RandomChoice - /// - /// - /// var flowerColor = Dice.RandomChoice(new List() - /// { - /// new Colour(ConsoleColor.Magenta, ConsoleColor.Green), - /// new Colour(ConsoleColor.Red, ConsoleColor.Green), - /// new Colour(ConsoleColor.Yellow, ConsoleColor.Green), - /// new Colour(ConsoleColor.DarkMagenta, ConsoleColor.Green), - /// }); - /// - /// - /// Not dissimilar to Pythons random choice. - /// - /// The type of the object to return for - /// the random choice. - /// The object that will be used to get a random element from. - /// A "randomly" selected element from the list. - public static T RandomChoice(IList obj) - { - // TODO: Rehash this a bit; not so hot the more i loot at it. - return obj[R.Random.Next(0, obj.Count)]; - } - - /// - /// a little better. - /// - /// - /// - /// - public static T RandomChoice(T[] obj) - { - return obj[R.Random.Next(0, obj.Length)]; - } - } -} diff --git a/src/DotNetHack/Game/Direction.cs b/src/DotNetHack/Game/Direction.cs deleted file mode 100644 index 96d7608..0000000 --- a/src/DotNetHack/Game/Direction.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game -{ - public enum Direction { Up, Down, Left, Right } - - /// - /// RandomDirection is used for random walks. - /// - public static class RandomDirection - { - /// - /// Static constructor for random direction. - /// - static RandomDirection() - { - Directions.Add(Direction.Down); - Directions.Add(Direction.Left); - Directions.Add(Direction.Up); - Directions.Add(Direction.Right); - } - - /// - /// A starting list of direction. - /// - public static List Directions = new List(); - - /// - /// Apply a random direction to a location. - /// - /// The location to apply a random direction to. - public static void ApplyTo(Location2i aLocation) - { - switch (RandomDirection.Get) - { - case Direction.Up: - aLocation.Y--; break; - case Direction.Right: - aLocation.X++; break; - case Direction.Down: - aLocation.Y++; break; - case Direction.Left: - aLocation.X--; break; - } - } - - /// - /// Get a random direction. - /// - public static Direction Get - { - get { return Dice.RandomChoice(Directions); } - } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Dungeon.cs b/src/DotNetHack/Game/Dungeon/Dungeon.cs deleted file mode 100644 index 4c3a427..0000000 --- a/src/DotNetHack/Game/Dungeon/Dungeon.cs +++ /dev/null @@ -1,495 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Text; -using System.Xml.Serialization; -using System.Collections.Generic; -using System.Runtime.Serialization.Formatters.Binary; - - -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Dungeon.Tiles; -using DotNetHack.Game.NPC; - -namespace DotNetHack.Game.Dungeon -{ - /// - /// IterXYDelegate - /// - /// The x-coord - /// The y-coord - internal delegate void IterXYDelegate(int x, int y); - - /// - /// Used as an argument for interating over all dungeon tiles. This - /// is a common operation. so it's been crafted into a delegate. - /// - /// x parameter - /// y parameter - /// d parameter - public delegate void DungeonIterator(int x, int y, int d); - - /// - /// DungeonExtensions - /// - public static class DungeonExtensions - { - /// - /// SaveAs - /// - public static void SaveAs(this Dungeon3 aLevel, string aMapFile) - { - string fullPath = Path.Combine(R.WorkingDirectory, - aMapFile + Dungeon3.DungeonExtension); - // Create a new binary formatter - BinaryFormatter binFormatter = new BinaryFormatter(); - using (FileStream tmpRawStream = File.Open(fullPath, FileMode.OpenOrCreate)) - binFormatter.Serialize(tmpRawStream, aLevel); - } - } - - /// - /// Dungeon3 is an experimental dungeon that has a third dimension. - /// - [Serializable] - public class Dungeon3 - { - #region Constructors - - /// - /// Parameterless constructor supports serialization. - /// - public Dungeon3() { } - - /// - /// Creates a new empty dungeon with the passed parameters. - /// - /// The width of the dungeon. - /// The height of the dungeon. - /// The depth of the dungeon. - public Dungeon3(int w, int h, int d) - { - // Set the width, height and depth. - DungeonWidth = w; DungeonHeight = h; DungeonDepth = d; - - // Initialize the mapdata array. - MapData = new Tile[w, h, d]; - - // Set all dungeon tiles to empty. - IterateDungeonData(delegate(int x, int y, int depth) - { - SetTile(x, y, depth, Tile.EmptyTile); - }); - - // Create a new dungeon renderer using this as the dungeon. - DungeonRenderer = new DungeonRenderer(this); - - // Create the list of NPC's in this dungeon. - NonPlayerControlled = new List(); - -#if FOG_OF_WAR - // Create a new dungeon renderer using this as the dungeon. - FogOfWar = new FogOfWar(this); -#endif - } - - #endregion - - #region Public Delegates - - /// - /// IterateDungeonData will iterate of all dungeon data and call the DungeonIterator. - /// This is the preferred method to iterate over all dungeon data - /// - /// - public void IterateDungeonData(DungeonIterator aDungeonIterator) - { - for (int d = 0; d < DungeonDepth; ++d) - for (int x = 0; x < DungeonWidth; ++x) - for (int y = 0; y < DungeonHeight; ++y) - aDungeonIterator(x, y, d); - } - - #endregion - - #region Public Facing Methods - - /// - /// Wipes everything from the face of this dungeon. - /// - public void WipeDungeon() - { - NonPlayerControlled = new List(); - DungeonRenderer = new DungeonRenderer(this); - foreach (ITile t in TileIterator) - { - t.G = '\0'; - t.C = Colour.Standard; - t.Items = new Items.ItemCollection(); - t.TileFlags = TileFlags.None; - t.TileType = TileType.Nothing; - } - } - - public void Render(Location3i aLoc) { DungeonRenderer.Render(aLoc); } - - /// - /// Load - /// - /// The map file to load. - /// - /// - public static Dungeon3 Load(string aMapFile) - { - string fullPath = Path.Combine(R.WorkingDirectory, - aMapFile + DungeonExtension); - BinaryFormatter binFormatter = new BinaryFormatter(); - using (FileStream tmpRawStream = File.Open(fullPath, FileMode.Open)) - return (Dungeon3)binFormatter.Deserialize(tmpRawStream); - } - - /// - /// Returns the specified tile. - /// - /// The x-coordinate of the tile to get. - /// The y-coordinate of the tile to get. - /// The dungeon level of the tile to get. - /// - public Tile GetTile(int x, int y, int d) { return MapData[x, y, d]; } - - /// - /// Get the tile for an object that supports the HasLocation interface - /// - /// Any object that has a location. - /// The tile at that location. - public Tile GetTile(IHasLocation aHasLoc) - { - return GetTile(aHasLoc.Location); - } - - /// - /// GetTile - /// - /// - /// - /// - public Tile GetTile(Location3i l) { return GetTile(l.X, l.Y, l.D); } - - /// - /// GetTile - /// - /// - /// - /// - public Tile GetTile(Location2i l, int d) { return MapData[l.X, l.Y, d]; } - - /// - /// SetTile will set the passed tile at the passed location parameters. - /// - /// The x-coordinate of the tile to set. - /// The y-coordinate of the tile to set. - /// The depth of the tile to set. - /// The tile object to set at the location. - public void SetTile(int x, int y, int d, Tile aTile) { MapData[x, y, d] = aTile; } - - /// - /// SetTile will set the passed tile at the passed location parameters. - /// - /// l3i to set - /// tile to set - public void SetTile(Location3i l, Tile aTile) { MapData[l.X, l.Y, l.D] = aTile; } - - /// - /// Spawns an NPC monster into the dungeon. - /// the monster knows about his/her/it's location. - /// - public void SpawnNPC(NonPlayerControlled aNPC) - { - aNPC.Initialize(); - aNPC.Spawn(this); - NonPlayerControlled.Add(aNPC); - } - - /// - /// IsPassable - /// This method is used for shared collision detection. - /// - /// - public bool IsPassable(Location3i l) - { - //if (GameEngine.Player.Location == l) - //return false; - Tile tmpTile = GetTile(l); - if (GetNPC(l) != null) - return false; - return !tmpTile.Impassable; - } - - /// - /// Determines if there is a monster at this location. - /// - /// The location. - /// - public NonPlayerControlled GetNPC(Location3i l) - { - return NonPlayerControlled.Where(m => m.Location == l) - .FirstOrDefault(); - } - - /// - /// CheckBounds - /// - /// - /// - public bool CheckBounds(Location3i l) - { - Location3i lLowerRight = Location3i.GetNew(DungeonWidth, DungeonHeight, DungeonDepth); - if (l < Location3i.Origin3i) - return false; - else if (l >= lLowerRight) - return false; - return true; - } - - #endregion - - #region Public Facing Properties - - public IEnumerable TileIterator - { - get - { - // can't use yield return inside lambdas - for (int d = 0; d < DungeonDepth; ++d) - for (int x = 0; x < DungeonWidth; ++x) - for (int y = 0; y < DungeonHeight; ++y) - yield return MapData[x, y, d]; - } - } - - /// - /// Used specificially to render this dungeon - /// - [XmlIgnore] - public DungeonRenderer DungeonRenderer { get; set; } - -#if FOG_OF_WAR - /// - /// Used specifically to make fog of war calculations. - /// - [XmlIgnore] - public FogOfWar FogOfWar { get; set; } -#endif - - /// - /// The height of this dungeon. - /// This is not the same as depth. - /// - public int DungeonHeight { get; private set; } - - /// - /// The width of this dungeon - /// - public int DungeonWidth { get; private set; } - - /// - /// The depth of this dungeon - /// - public int DungeonDepth { get; private set; } - - /// - /// MapData contains all data that pretains to the physicality of the dungeon. - /// - public Tile[, ,] MapData { get; private set; } - - /// - /// all non player controlled characters. - /// - public List NonPlayerControlled { get; private set; } - - #endregion - - #region Supporting Structs & Classes - - // TODO: DungeonLocation *is a* Location. - - /// - /// DungeonLocation is a location that specifically refers to a - /// location inside of a dungeon that has depth. - /// - [Serializable] - public class DungeonLocation - { - /// - /// Creates a new DungeonLocation with the passed parameters that - /// refer to the specific Location. - /// - /// The x-coordinate of the dungeon location. - /// The y-coordinate of the dungeon location. - /// The depth of the dungeon location. - public DungeonLocation(int x, int y, int d) { X = x; Y = y; D = d; } - - /// - /// The x-coordinate of this dungeon location. - /// - public int X { get; set; } - - /// - /// The y-coordinate of this dungeon location. - /// - public int Y { get; set; } - - /// - /// The depth of this dungeon location. - /// - public int D { get; set; } - } - - #endregion - - #region Constants - /// - /// DungeonExtension - /// - public const string DungeonExtension = ".dungeon"; - #endregion - } - -#if OBSOLETE - [Serializable] - public class Dungeon - { - public Dungeon() { } - - public Dungeon(int w, int h) - { - Width = w; - Height = h; - - MapData = new MapTile[w, h]; - RenderBuffer = new MapTile[w, h]; - - IterXY(delegate(int x, int y) - { - MapData[x, y] = new MapTile(new Location2i(x, y)) - { - TileType = TileType.FLOOR, - C = Colour.Standard, - G = '.', - }; - }); - - ClearBuffer(); - } - - public void ClearBuffer() - { - IterXY(delegate(int x, int y) - { - RenderBuffer[x, y] = new MapTile(x, y) { G = ' ' }; - }); - } - - public void Render(Location l) - { - foreach (IItem iItem in Items) - UI.Graphics.Draw(iItem); - - IterXY(delegate(int x, int y) - { - if (RenderBuffer[x, y].G != MapData[x, y].G) - { - UI.Graphics.CursorToLocation(x, y); - MapData[x, y].C.Set(); - Console.Write(MapData[x, y].G); - RenderBuffer[x, y].G = MapData[x, y].G; - UI.Graphics.CursorToLocation(x, y); - } - }); - - foreach (IItem iItem in Items) - { - int x1 = iItem.Location.X; - int y1 = iItem.Location.Y; - iItem.C.SetBG(MapData[x1, y1].C.BG); - UI.Graphics.Draw(iItem); - } - - RenderBuffer[l.X, l.Y].G = '\0'; - } - - public void SetAllTiles(Tile aTile) - { - IterXY(delegate(int x, int y) - { - if (MapData[x, y].TileType == TileType.NOTHING) - MapData[x, y] = new MapTile(x, y) - { - C = aTile.C, - G = aTile.G, - TileType = aTile.TileType, - }; - }); - } - - void IterXY(IterMapTiles aMapIterator) - { - for (int x = 0; x < Width; ++x) - for (int y = 0; y < Height; ++y) - aMapIterator(x, y); - } - - delegate void IterMapTiles(int x, int y); - - public void SetMapTile(MapTile aMapTile) { MapData[aMapTile.Location.X, aMapTile.Location.Y] = aMapTile; } - - public Tile GetTile(Location aLocation) { return GetTile(aLocation.X, aLocation.Y); } - - public Tile GetTile(int x, int y) { return (Tile)MapData[x, y]; } - - public bool CheckBounds(Location2i l) - { - Location2i lLowerRight = new Location2i(Width, Height); - if (l < Location2i.Origin2i) - return false; - else if (l >= lLowerRight) - return false; - return true; - } - - public List Items = new List(); - - public int Width { get; private set; } - - public int Height { get; private set; } - - public MapTile[,] MapData { get; set; } - - [XmlAttribute("MapFile")] - public string MapFile { get; set; } - - [XmlIgnore] - IGlyph[,] RenderBuffer { get; set; } - - /// - /// ToString - /// - /// - public override string ToString() { return MapFile; } - - public const int Y_OFFSET = 2; - - /// - /// Load - /// - /// The map file to load. - /// - public static Dungeon Load(string aMapFile) - { - BinaryFormatter binFormatter = new BinaryFormatter(); - using (FileStream tmpRawStream = File.Open(aMapFile, FileMode.Open)) - return (Dungeon)binFormatter.Deserialize(tmpRawStream); - } - } -#endif -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Dungeon/DungeonRenderer.cs b/src/DotNetHack/Game/Dungeon/DungeonRenderer.cs deleted file mode 100644 index 96a3419..0000000 --- a/src/DotNetHack/Game/Dungeon/DungeonRenderer.cs +++ /dev/null @@ -1,170 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Dungeon.Tiles; -using DotNetHack.Game.Interfaces; -using DotNetHack.UI; -using DotNetHack.Game.NPC; - -namespace DotNetHack.Game.Dungeon -{ - /// - /// DungeonRenderer - /// - [Serializable()] - public class DungeonRenderer - { - /// - /// DungeonRenderer - /// - /// - public DungeonRenderer(Dungeon3 aDungeon) - { - RenderDungeon = aDungeon; // must be set first - RenderBuffer = new Tile[Width, Height]; - ClearBuffer(); - } - - /// - /// IterateXY - /// - /// - void IterateXY(IterXYDelegate aMapIterator) - { - for (int x = 0; x < Width; ++x) - for (int y = 0; y < Height; ++y) - aMapIterator(x, y); - } - - /// - /// Clears a render buffer location. - /// - /// - public void ClearLocation(Location2i l) - { - RenderBuffer[l.X, l.Y].G = '\0'; - } - - /// - /// ClearBuffer - /// - public void ClearBuffer() - { - IterateXY(delegate(int x, int y) - { - RenderBuffer[x, y] = new Tile() { G = '\0', TileType = TileType.Nothing }; - }); - } - - /// - /// HardRefresh - /// - /// - public void HardRefresh(Location3i l) - { - IterateXY(delegate(int x, int y) - { - UI.Graphics.CursorToLocation(x, y); - RenderDungeon.MapData[x, y, l.D].C.Set(); - Console.Write(RenderDungeon.MapData[x, y, l.D].G); - RenderBuffer[x, y].G = RenderDungeon.MapData[x, y, l.D].G; - UI.Graphics.CursorToLocation(x, y); - }); - } - - /// - /// RefreshBufferedRegion, refreshes the buffer for a two dimensional region - /// of the screen. The reason that is passed is that - /// we need to know the dungeon level so that we draw the correct boundground data. - /// - /// The location (dungeon level to render with) - /// The buffered region to re-render/ refresh. - public void RefreshBufferedRegion(Location3i l, DisplayRegion r) - { - for (int x = r.P1.X; x < r.P2.X; ++x) - for (int y = r.P1.Y; y <= r.P2.Y; ++y) - { - UI.Graphics.CursorToLocation(x, y); - RenderDungeon.MapData[x, y, l.D].C.Set(); - Console.Write(RenderDungeon.MapData[x, y, l.D].G); - RenderBuffer[x, y].G = RenderDungeon.MapData[x, y, l.D].G; - } - } - - /// - /// Render, renders the Dungeon that this DungeonRenderer is wired to. - /// - /// This location/point is refreshed, because we assume the player moved. - public void Render(Location3i l) - { -#if FOG_OF_WAR - // TODO: This shit should be else where, and may even benefit from - // being called as part of several methods in a multicast delegate that - // run each time render is called on a location. - RenderDungeon.FogOfWar.UpdateSeenData(l, 6); -#endif - - IterateXY(delegate(int x, int y) - { -#if FOG_OF_WAR - if (RenderDungeon.FogOfWar.Seen(x, y, l.D)) -#endif - if (RenderBuffer[x, y].G != RenderDungeon.MapData[x, y, l.D].G) - { - UI.Graphics.CursorToLocation(x, y); - if (RenderDungeon.MapData[x, y, l.D].Items.Count <= 0) - RenderDungeon.MapData[x, y, l.D].C.Set(); - else RenderDungeon.MapData[x, y, l.D].Items.Peek().C.Set(); - Console.Write(RenderDungeon.MapData[x, y, l.D].G); - RenderBuffer[x, y].G = RenderDungeon.MapData[x, y, l.D].G; - UI.Graphics.CursorToLocation(x, y); - } - }); - - // draw all non player controlled characters. - foreach (var npc in RenderDungeon.NonPlayerControlled) - { - // clear the location. - ClearLocation(npc.Location); - - // Draw the location. - npc.Draw(); - } - - ClearLocation(l); - } - - /// - /// DungeonLevelGlyphs enumerable - /// - /// - IEnumerable DungeonLevelGlyphs() - { - for (int x = 0; x < Width; ++x) - for (int y = 0; y < Height; ++y) - yield return RenderBuffer[x, y]; - } - - /// - /// DungeonWidth - /// - public int Width { get { return RenderDungeon.DungeonWidth; } } - - /// - /// DungeonHeight - /// - public int Height { get { return RenderDungeon.DungeonHeight; } } - - /// - /// The render buffer - /// - IGlyph[,] RenderBuffer { get; set; } - - /// - /// The dungeon renderer. - /// - Dungeon3 RenderDungeon { get; set; } - } - -} diff --git a/src/DotNetHack/Game/Dungeon/FogOfWar.cs b/src/DotNetHack/Game/Dungeon/FogOfWar.cs deleted file mode 100644 index 871bfdf..0000000 --- a/src/DotNetHack/Game/Dungeon/FogOfWar.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Dungeon -{ - /// - /// FogOfWar - /// - [Serializable] - public class FogOfWar - { - /// - /// FogOfWar - /// - /// - public FogOfWar(Dungeon3 aDungeon) - { - // Set the linked dungeon. - FogOfWarDungeon = aDungeon; - - // Mimc the size and shape of the dungeon. - SeenData = new bool[aDungeon.DungeonWidth, aDungeon.DungeonHeight, - aDungeon.DungeonDepth]; - } - - /// - /// UpdateSeenData - /// - /// The location to update "seen" data with. - public void UpdateSeenData(Location3i aLocation, double aSightDistance) - { - SeenRadius(delegate(int x, int y) - { - // Compute the distance from the passed location to the - // [x, y] in the iterator - if (Location2i.GetNew(x,y).Distance(aLocation) <= aSightDistance) - SeenData[x, y, aLocation.D] = true; - }); - } - - /// - /// Seen - /// - /// x-coord - /// y-coord - /// d-coord - /// true if the tile has been seen. - public bool Seen(int x, int y, int d) - { - return SeenData[x, y, d]; - } - - /// - /// IterXYDelegate - /// - /// x,y iterator delegate - void SeenRadius(IterXYDelegate d) - { - for (int x = 0; x < FogOfWarDungeon.DungeonWidth; ++x) - for (int y = 0; y < FogOfWarDungeon.DungeonHeight; ++y) - d(x, y); - } - - /// - /// SeenData is a three dimensional array that mimics the size and shape of - /// the dungeon that was used to create the FogOfWar object. - /// - bool[, ,] SeenData { get; set; } - - /// - /// Linked back to the dungeon. - /// - private readonly Dungeon3 FogOfWarDungeon; - } -} diff --git a/src/DotNetHack/Game/Dungeon/Generator/DungeonGenerator.cs b/src/DotNetHack/Game/Dungeon/Generator/DungeonGenerator.cs deleted file mode 100644 index f07addc..0000000 --- a/src/DotNetHack/Game/Dungeon/Generator/DungeonGenerator.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Dungeon.Generator -{ - /// - /// DungeonGenerator - /// - public abstract class DungeonGenerator : IDungeonGenerator - { - public DungeonGenerator(Dungeon3 aDungeon) { Dungeon = aDungeon; } - public abstract void Generate(int d); - protected Dungeon3 Dungeon { get; set; } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Generator/DungeonGeneratorRecursiveDescent.cs b/src/DotNetHack/Game/Dungeon/Generator/DungeonGeneratorRecursiveDescent.cs deleted file mode 100644 index 5c846de..0000000 --- a/src/DotNetHack/Game/Dungeon/Generator/DungeonGeneratorRecursiveDescent.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Dungeon.Generator -{ - /// - /// DungeonGeneratorRecursiveDescent - /// - public class DungeonGeneratorRecursiveDescent : DungeonGenerator, IDungeonGenerator - { - /// - /// DungeonGeneratorRecursiveDescent - /// WARNING: dungeon will be wiped. - /// - /// - public DungeonGeneratorRecursiveDescent(Dungeon3 aDungeon) - : base(aDungeon) - { } - - /// - /// Generates the dungeon using recursive descent model. - /// - public override void Generate(int d) - { - if (d >= Dungeon.DungeonDepth) - return; - Generate(++d); - } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Generator/DungeonRegion.cs b/src/DotNetHack/Game/Dungeon/Generator/DungeonRegion.cs deleted file mode 100644 index 81b6a0e..0000000 --- a/src/DotNetHack/Game/Dungeon/Generator/DungeonRegion.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Utility; -using DotNetHack.Game.Dungeon.Tiles; - -namespace DotNetHack.Game.Dungeon.Generator -{ - /// - /// DungeonRegion - /// - public class DungeonRegion : Rectangle - { - /// - /// Creates a new dungeon region. - /// - /// The first point used for form the region - /// The second point used to for the region. - public DungeonRegion(Dungeon3 d, Location2i a, Location2i b) - : base(a, b) - { Dungeon = d; } - - /// - /// Creates a new dungeon region. - /// - /// x-coord of the first point used to form the region - /// y-coord of the first point used to form the region - /// x-coord of the second point used to form the region - /// y-coord of the second point used to form the region - public DungeonRegion(Dungeon3 d, int x1, int y1, int x2, int y2) - : base(x1, y1, x2, y2) { Dungeon = d; } - - /// - /// Returns an enumeration over the dungeon regions tiles. - /// This is highly dependent upon the dungeon level so d is passed - /// as a parameter. - /// - /// logical failure - public IEnumerable RegionTiles(int d) - { - if (P1.Equals(P2)) - // P1 and P2 are on the same tile, return the tile. - yield return Dungeon.GetTile(P1, d); - else if (P1 < P2) - { - // starting @ P1, moving to P2 - for (int x = P1.X; x < P2.X; ++x) - for (int y = P1.Y; y < P2.Y; ++y) - yield return Dungeon.GetTile(Location3i.GetNew(x, y, d)); - } - else if (P2 < P1) - { - // starting @ P2, moving to P1 - for (int x = P2.X; x < P1.X; ++x) - for (int y = P2.Y; y < P1.Y; ++y) - yield return Dungeon.GetTile(Location3i.GetNew(x, y, d)); - } - // the x-coord(s) align, || the y-coords align - else - { - // the x-coordinates align. - if (P1.X == P2.X) - { - /// - /// working with the y-coordinate. - /// - - if (P1.Y < P2.Y) - { - // P1 on "top" - for (int y = P1.Y; y < P2.Y; ++y) - yield return Dungeon.GetTile( - Location3i.GetNew(P1.X, y, d)); - } - else if (P2.Y < P1.Y) - { - // P2 on "top" - for (int y = P2.Y; y < P1.Y; ++y) - yield return Dungeon.GetTile( - Location3i.GetNew(P1.X, y, d)); - } - else new DNHackException("logical failure"); - } - // the y-coordinates align. - else if (P1.Y == P2.Y) - { - /// - /// working with the x-coordinate. - /// - - if (P1.X < P2.X) - { - // P1 on "left" - for (int x = P1.X; x < P2.X; ++x) - yield return Dungeon.GetTile( - Location3i.GetNew(x, P1.Y, d)); - } - else if (P2.X < P1.X) - { - // P2 on "left" - for (int x = P2.X; x < P1.X; ++x) - yield return Dungeon.GetTile( - Location3i.GetNew(x, P1.Y, d)); - } - else new DNHackException("logical failure"); - } - else new DNHackException("logical failure"); - } - } - - /// - /// Check 2d-boundaries of this dungeon region. - /// preconditions, dungeon must have at least one floor. - /// - /// - public bool CheckBounds() - { - var p1 = Location3i.GetNew(P1.X, P1.Y, 0); - var p2 = Location3i.GetNew(P2.X, P2.Y, 0); - return Dungeon.CheckBounds(p1) && Dungeon.CheckBounds(p2); - } - - /// - /// The dungeon region maintains a reference to the dungeon, this - /// would be that reference. - /// - Dungeon3 Dungeon { get; set; } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Generator/IDungeonGenerator.cs b/src/DotNetHack/Game/Dungeon/Generator/IDungeonGenerator.cs deleted file mode 100644 index bda929d..0000000 --- a/src/DotNetHack/Game/Dungeon/Generator/IDungeonGenerator.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace DotNetHack.Game.Dungeon.Generator -{ - /// - /// IDungeonGenerator - /// - public interface IDungeonGenerator - { - void Generate(int d); - } -} diff --git a/src/DotNetHack/Game/Dungeon/IDungeonLevel.cs b/src/DotNetHack/Game/Dungeon/IDungeonLevel.cs deleted file mode 100644 index 0afe94b..0000000 --- a/src/DotNetHack/Game/Dungeon/IDungeonLevel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using DotNetHack.Game.Interfaces; -namespace DotNetHack.Game.Dungeon -{ - interface IDungeonLevel - { - string MapFile { get; set; } - void Render(Location2i aLocation); - } -} diff --git a/src/DotNetHack/Game/Dungeon/TileBuilder.cs b/src/DotNetHack/Game/Dungeon/TileBuilder.cs deleted file mode 100644 index 2acac5a..0000000 --- a/src/DotNetHack/Game/Dungeon/TileBuilder.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Dungeon.Tiles; - -namespace DotNetHack.Game.Dungeon -{ - /// - /// TileBuilder - /// - public static class TileBuilder - { - - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/Door.cs b/src/DotNetHack/Game/Dungeon/Tiles/Door.cs deleted file mode 100644 index 7795d80..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/Door.cs +++ /dev/null @@ -1,138 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Dungeon.Tiles -{ - /// - /// Door - /// A door is a movable structure used to close off an entrance, typically consisting of a panel that swings on hinges or that slides or rotates inside of a space. - /// - /// - [Serializable] - public class Door : Tile, IGlyph, IHasLock, IHasLocation - { - /// - /// Creates a new instance of Door. - /// - public Door(bool aOpen = false, bool aLocked = false) - : base('+', Colour.Door, TileFlags.Door) - { - InternalDoorState = aOpen ? - DoorState.Opened : Door.DoorState.Closed; - IsLocked = aLocked; - if (IsLocked) InternalDoorState = DoorState.Closed; - } - - private enum DoorState { Opened, Closed } - private DoorState InternalDoorState { get; set; } - public bool IsOpen { get { return InternalDoorState == DoorState.Opened; } } - public bool IsClosed { get { return InternalDoorState == DoorState.Closed; } } - public bool IsLocked { get; set; } - - public virtual void CloseDoor() - { - GameEngine.DoSound(new Sound(this, 40, "switch_1.wav")); - InternalDoorState = DoorState.Closed; - } - - public virtual void OpenDoor() - { - GameEngine.DoSound(new Sound(10, "switch_1.wav")); - InternalDoorState = DoorState.Opened; - } - - /// - /// override char G to be dependent upon the door state. - /// - public override char G - { - get - { - switch (InternalDoorState) - { - case DoorState.Closed: - DoorGlyph = DOOR__CLOSED_GLYPH; - break; - case DoorState.Opened: - DoorGlyph = DOOR__OPENED_GLYPH; - break; - } - - return DoorGlyph; - } - set { DoorGlyph = value; } - } - - /// - /// The glyph used to represent this door. - /// - private char DoorGlyph; - - /// - /// Returns a new closed door - /// - /// - public static Door NewDoor(Guid aGuid, bool aOpen = false) - { - return new Door(aOpen, true) { KeyRef = aGuid }; - } - - /// - /// - /// - /// - /// - public static Door NewDoor(bool aOpen = false) - { - return new Door(aOpen) { KeyRef = Guid.Empty }; - } - - /// - /// NewDoor - /// - /// The location of the door - /// Is the door open? - /// The new door - public static Door NewDoor(Location3i l, bool open = false) - { - var retVal = new Door(open) { KeyRef = Guid.Empty }; - retVal.Location = l; - return retVal; - } - - /// - /// KeyRef - /// - public Guid KeyRef { get; set; } - - /// - /// The location of the door. - /// Used for sound. - /// - public Location3i Location { get; set; } - - /// - /// Represents a closed door - /// - const char DOOR__CLOSED_GLYPH = '+'; - - /// - /// Represents an open door. - /// - const char DOOR__OPENED_GLYPH = '/'; - - public bool UnLock(IKey aKey) - { - if (IsLocked) - if (aKey.KeyGuid.Equals(KeyRef)) - { - GameEngine.DoSound(new Sound(this, 30, "click")); - IsLocked = false; - } - return IsLocked; - } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/HerbSpawn.cs b/src/DotNetHack/Game/Dungeon/Tiles/HerbSpawn.cs deleted file mode 100644 index 0a79d24..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/HerbSpawn.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items.Herbs; - -namespace DotNetHack.Game.Dungeon.Tiles -{ - /// - /// HerbSpawn - /// - [Serializable] - public class HerbSpawn : Tile, IHasLocation - { - /// - /// Serializable - /// - public HerbSpawn() - { - - } - - /// - /// Creates a new instance of an herb-spawn. - /// - public HerbSpawn(Herb aHerb, long aTimeToRespawn) - : base(aHerb.G, aHerb.C) - { - TileFlags = Tiles.TileFlags.Spawn; - - // Set spawn resource. - Resource = aHerb; - - // set the last visited time to min-value. - TicksSinceLastVisited = TimeToRespawn; - TimeToRespawn = aTimeToRespawn; - - // register tick listener w/ main game-engine tick hdlr. - GameEngine.OnTick += new EventHandler(GameEngine_OnTick); - } - - /// - /// GameEngine_OnTick - /// - /// - /// - void GameEngine_OnTick(object sender, EventArgs e) - { - // if (TimeToRespawn > TicksSinceLastVisited) - TicksSinceLastVisited++; - } - - /// - /// The last time this herb spawn was last visited. - /// - public long TicksSinceLastVisited; - - /// - /// The herb spawned up by this spawn tile. - /// - public Herb Resource { get; set; } - - /// - /// The location of this herb spawn. - /// - public Location3i Location { get; set; } - - /// - /// TTL - /// - readonly long TimeToRespawn; - - /// - /// Take - /// - /// - public Herb Take() - { - TicksSinceLastVisited++; - if (TicksSinceLastVisited >= TimeToRespawn) - { - TicksSinceLastVisited = 0L; - return Resource; - } - return null; - } - - /// - /// CanTake - /// - public bool CanTake - { - get { return (TimeToRespawn > TicksSinceLastVisited); } - } - - /// - /// NewHerbSpawn - /// - /// New HerbSpawn - public static HerbSpawn NewHerbSpawn(Herb.HerbType aHerbType, int spawnTimeOffset = 0) - { - return new HerbSpawn(new Herb(aHerbType), 500 + spawnTimeOffset); - } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/ITile.cs b/src/DotNetHack/Game/Dungeon/Tiles/ITile.cs deleted file mode 100644 index fa223f3..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/ITile.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using DotNetHack.Game.Interfaces; -using System.Collections.Generic; -using DotNetHack.Game.Items; -namespace DotNetHack.Game.Dungeon.Tiles -{ - /// - /// ITile interface - /// - public interface ITile : IGlyph - { - bool HasItems { get; } - ItemCollection Items { get; set; } - TileFlags TileFlags { get; set; } - TileType TileType { get; set; } - bool Impassable { get; } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/Tile.cs b/src/DotNetHack/Game/Dungeon/Tiles/Tile.cs deleted file mode 100644 index 1fa555a..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/Tile.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.UI; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game.Dungeon.Tiles -{ - -#if OBSOLETE - /// - /// MapTile - /// - [Serializable] - public class MapTile : Tile, IHasLocation, IEquatable - { - public MapTile(Location3i aTileLocation) - : base() - { Location = aTileLocation; } - - public MapTile(int x, int y) - : base() - { Location = new Location3i(x, y); } - - public MapTile(int x, int y, Tile aTile) - : this(x, y) - { - TileType = aTile.TileType; - G = aTile.G; - C = aTile.C; - } - - public Location Location { get; set; } - - public bool Equals(MapTile other) - { - return Location.Equals(other.Location); - } - - public override int GetHashCode() - { - return this.Location.GetHashCode(); - } - - public override bool Equals(object obj) - { - return base.Equals(obj); - } - } - -#endif - - /// - /// Tile - /// - [Serializable] - public class Tile : IGlyph, DotNetHack.Game.Dungeon.Tiles.ITile - { - /// - /// Tile - /// - public Tile() - { - TileGlyph = '\0'; - C = new Colour(); - Items = new ItemCollection(); - } - - /// - /// Creates a new tile with the passed parameters - /// - /// The glyph representing this tile. - /// The color of this tile. - public Tile(char aGlyph, Colour aColour) - : this(aGlyph, aColour, TileFlags.None) { } - - /// - /// Creates a new tile with the passed parameters - /// - /// The glyph representing this tile. - /// The color of this tile. - /// The flags present on this tile. - public Tile(char aGlyph, Colour aColour, TileFlags aFlags) - { - G = aGlyph; - C = aColour; - TileFlags = aFlags; - Items = new ItemCollection(); - } - - /// - /// Tile Type - /// - public TileType TileType { get; set; } - - /// - /// TileFlags - /// - public TileFlags TileFlags { get; set; } - - /// - /// Tile Glyph - /// - public virtual char G - { - get - { - if (HasItems) - return Items.First().G; - return TileGlyph; - } - set { TileGlyph = value; } - } - - /// - /// TileGlyph - /// - private char TileGlyph { get; set; } - - /// - /// Returns true if this tile has items on it. - /// - public bool HasItems { get { return Items.Count > 0; } } - - /// - /// Color - /// - public Colour C { get; set; } - - /// - /// Items - /// The following method for storing items is experiemental. - /// - // public Stack Items { get; set; } - - public ItemCollection Items { get; set; } - - /// - /// EmptyTile has standard colour, a '.' as the Glyph and Nothing as the TileType. - /// - public static Tile EmptyTile - { - get - { - return new Tile() - { - C = Colour.Standard, - G = '.', - TileType = TileType.Nothing, - }; - } - } - - - /// - /// Is this tile impassable? - /// - public bool Impassable - { - get - { - // Certain types of tiles are simply not passable. - switch (TileType) - { - case Tiles.TileType.Wall: - case Tiles.TileType.Water: - case Tiles.TileType.Tree: - case Tiles.TileType.Fountain: - return true; - } - - // Then there are some tiles that are special and have flags - // in the case of doors, the tile may or may not be passable. - switch (TileFlags) - { - case Tiles.TileFlags.Door: - return ((Door)this).IsClosed; - } - - return false; - } - } - } - -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/TileFlags.cs b/src/DotNetHack/Game/Dungeon/Tiles/TileFlags.cs deleted file mode 100644 index 8e41757..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/TileFlags.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Dungeon.Tiles -{ - /// - /// TileFlags represet the various flags that a tile may have. - /// These flags may be stacked. - /// - [Flags] - public enum TileFlags - { - None = 1, - Door = 2, - Trap = 4, - Secret = 8, - Shop = 16, - Sacred = 32, - Stairs = 64, - Spawn = 128, - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/TileType.cs b/src/DotNetHack/Game/Dungeon/Tiles/TileType.cs deleted file mode 100644 index bfe76d7..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/TileType.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Dungeon.Tiles -{ - /// - /// TileType - /// - public enum TileType - { - Nothing, - Floor, - Wall, - Door, - Fountain, - Altar, - Tree, - Grass, - Mountain, - Water, - Field, - Grave, - Road, - Home, - StairsUp, - StairsDown, - Bridge, - Swamp, - Forest, - Herb, - Beach, - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/Traps/Trap.cs b/src/DotNetHack/Game/Dungeon/Tiles/Traps/Trap.cs deleted file mode 100644 index d2f4faa..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/Traps/Trap.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Dungeon.Tiles.Traps -{ - /// - /// Trap - /// - [Serializable] - public abstract class Trap : Tile, IGlyph - { - /// - /// Creates a new instance of Trap - /// This is the most basic form of trap. - /// - public Trap() - : base('^', Colour.Standard, TileFlags.Trap) - { } - - /// - /// TrapEventArgs - /// - public class TrapEventArgs : EventArgs - { - /// - /// Creates a new instance of trap event args - /// The actor that triggered the trap - /// - public TrapEventArgs(Actor aActor) { TrapTarget = aActor; } - - /// - /// TrapTarget, the actor responsibile for triggering the trap. - /// - public Actor TrapTarget { get; set; } - } - - /// - /// Occurs when the trap is triggered. - /// - /// - public virtual void OnTrapTriggeredEvent(TrapEventArgs e) - { - if (TriggerEvent != null && !Disabled) - TriggerEvent(this, e); - } - - /// - /// The trap trigger event handler. - /// - public event EventHandler TriggerEvent; - - /// - /// Has this trap been disabled? - /// - public bool Disabled { get; set; } - - /// - /// Calling this method will Disable this trap. - /// - public void Enable() { Disabled = false; } - - /// - /// Calling this trap will Enable this trap. - /// - public void Disable() { Disabled = true; } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/Traps/TrapFallingRock.cs b/src/DotNetHack/Game/Dungeon/Tiles/Traps/TrapFallingRock.cs deleted file mode 100644 index 4049635..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/Traps/TrapFallingRock.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Dungeon.Tiles.Traps -{ - /// - /// TrapFallingRock - /// - [Serializable] - public class TrapFallingRock : Trap - { - /// - /// Creates a new instance of TrapFallingRock - /// - public TrapFallingRock() - { - TriggerEvent += - new EventHandler(TrapFallingRock_TriggerEvent); - } - - /// - /// Occurs when the falling rock trap is triggered. - /// - /// The event sender - /// The event argument(s) - void TrapFallingRock_TriggerEvent(object sender, Trap.TrapEventArgs e) - { - GameEngine.DoSound(new Sound(e.TrapTarget, 40, - "thunderous rumbling")); - } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/Traps/TrapSpikePit.cs b/src/DotNetHack/Game/Dungeon/Tiles/Traps/TrapSpikePit.cs deleted file mode 100644 index 4c17dc2..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/Traps/TrapSpikePit.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Effects; - -namespace DotNetHack.Game.Dungeon.Tiles.Traps -{ - /// - /// TrapSpikePit - /// - [Serializable] - public class TrapSpikePit : Trap - { - /// - /// Creates a new instance of a spike pit trap. - /// - public TrapSpikePit() - : base() - { - TriggerEvent += new EventHandler(TrapSpikePit_TriggerEvent); - } - - /// - /// Occurs when the spike pit trap is triggered. - /// - /// The sender - /// Trap event arguments. - void TrapSpikePit_TriggerEvent(object sender, Trap.TrapEventArgs e) - { - // GameEngine.DoSound(new Sound(e.TrapTarget, 40, "shhhhing!!")); - - string strMessage = string.Format("You stepped into a {0} trap!", this); - if (Dice.D(e.TrapTarget.Stats.Agility) || Dice.D(e.TrapTarget.Stats.Luck)) - strMessage += " You were agile enough to avoid it!"; - else - { - e.TrapTarget.Stats.Health -= 10; - e.TrapTarget.WornArmour.ArmourMeleeStrike(null, e.TrapTarget); - } - - UI.Graphics.Display.ShowMessage(strMessage); - - Disable(); - } - - /// - /// ToString for TrapSpikePit. - /// - /// - public override string ToString() { return "spike pit"; } - } -} diff --git a/src/DotNetHack/Game/Dungeon/Tiles/Traps/Traps.cd b/src/DotNetHack/Game/Dungeon/Tiles/Traps/Traps.cd deleted file mode 100644 index 1a83d56..0000000 --- a/src/DotNetHack/Game/Dungeon/Tiles/Traps/Traps.cd +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - Game\Dungeon\Tiles\Traps\Trap.cs - - - - - AAAAAAAEAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAA= - Game\Dungeon\Tiles\Traps\Trap.cs - - - - - - - ACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Dungeon\Tiles\Traps\TrapSpikePit.cs - - - - - - AAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Dungeon\Tiles\Traps\TrapFallingRock.cs - - - - \ No newline at end of file diff --git a/src/DotNetHack/Game/DungeonLevel.cs b/src/DotNetHack/Game/DungeonLevel.cs deleted file mode 100644 index 584dd1f..0000000 --- a/src/DotNetHack/Game/DungeonLevel.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System; -using System.IO; -using System.Xml; -using System.Collections.Generic; - -using System.Xml.Serialization; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; - -using DotNetHack.Game.Monsters; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game -{ - /// - /// LevelExtensions - /// - public static class LevelExtensions - { - /// - /// SaveAs - /// - public static bool SaveAs(this DungeonLevel aLevel, string aMapFile) - { - try - { - // Create a new binary formatter - BinaryFormatter binFormatter = new BinaryFormatter(); - - using (FileStream tmpRawStream = File.Open(aMapFile,FileMode.OpenOrCreate)) - binFormatter.Serialize(tmpRawStream, aLevel); - - return true; - } - catch { return false; } - } - - /// - /// Save - /// - /// - /// - public static bool Save(this DungeonLevel aLevel) - { - return aLevel.SaveAs(aLevel.MapFile); - } - } - - /// - /// Level - /// - [Serializable] - public class DungeonLevel - { - /// - /// Level - /// - public DungeonLevel() - { - //Monsters = new HashSet(); - //Items = new HashSet(); - } - - /// - /// Level - /// - /// - /// - public DungeonLevel(int aWidth, int aHeight) - : this() - { - Width = aWidth; Height = aHeight; - Map = new Tile[aWidth, aHeight]; - RenderBuffer = new Tile[aWidth, aHeight]; - for (int w = 0; w < Width; ++w) - for (int h = 0; h < Height; ++h) - Map[w, h] = new Tile() { TileType = TileType.NOTHING, G = '.' }; - - // RenderBuffer[w, h] = new Tile() { TileType = TileType.NOTHING, G = '.' }; - - } - - /// - /// GetTile - /// - /// - /// - public Tile GetTile(Location aLocation) - { - return (Tile)Map[aLocation.X, aLocation.Y]; - } - - /// - /// Render - /// - /// - public void Render() - { - for (int w = 0; w < Width; ++w) - { - for (int h = 0; h < Height; ++h) - { - // There is no reason to draw something that has not changed. - // Note: h != Height -1 is provided to keep the text from - // travelling off of the screen. - //if (RenderBuffer[w, h] == Map[w, h] && h != Height - 1) - // continue; - - RenderBuffer[w, h] = Map[w, h]; - - Console.SetCursorPosition(w, h); - Console.ForegroundColor = RenderBuffer[w, h].C; - Console.SetCursorPosition(w, h); - Console.Write(RenderBuffer[w, h].G); - Console.ForegroundColor = ConsoleColor.Gray; - } - Console.Write('\n'); - } - } - - /// - /// Load - /// - /// The map file to load. - /// - public static DungeonLevel Load(string aMapFile) - { - BinaryFormatter binFormatter = new BinaryFormatter(); - using (FileStream tmpRawStream = File.Open(aMapFile, FileMode.Open)) - return (DungeonLevel)binFormatter.Deserialize(tmpRawStream); - } - - /// - /// MapFile - /// - public string MapFile { get; set; } - - /// - /// backing-store for the actual raw level data - /// without any sematic meaning(s) attached. - /// - public IGlyph[,] Map; - - /// - /// RenderBuffer - /// - [XmlIgnore] - public IGlyph[,] RenderBuffer; - - // The backing store for width and height. - public int Width, Height; - } -} - -/* -using System; -using System.Collections; -using System.Collections.Generic; -namespace DotNetHack -{ - public class Level - { - public Level(int aWidth, int aHeight) { - width = aWidth; height = aHeight; - map = new char [aWidth, aHeight]; - for(int w = 0; w < width; ++w) - for (int h = 0; h < height; ++h) - map[w, h] = LEVEL_INIT_CHAR; - generate(); - } - - public void draw() { - for(int w = 0; w < width; ++w) { - for (int h = 0; h < height; ++h) { - if (!map[w, h].Equals(LEVEL_INIT_CHAR)) { - Console.SetCursorPosition(w, h); - Console.Write(map[w, h]); - } - } - Console.Write('\n'); - } - } - - public void generate() { - - List tmpTypes = new List(); - tmpTypes.Add(TYPE_HALLWAY); tmpTypes.Add(TYPE_ROOM); - List tmpDirections = new List(); - tmpDirections.Add(DIR_UP); tmpDirections.Add(DIR_DOWN); - tmpDirections.Add(DIR_LEFT); tmpDirections.Add(DIR_RIGHT); - int mid_width = (int)(width / 2), x = mid_width; - int mid_height = (int)(height / 2), y = mid_height; - - #region First pass random walk - for (int index = 0; index < 50; ++index) { - switch (Utility.RandomChoice.Next(tmpDirections)) { - case DIR_UP: - map[x, y--] = FLOOR_CHAR; - break; - case DIR_DOWN: - map[x, y++] = FLOOR_CHAR; - break; - case DIR_LEFT: - map[x--, y] = FLOOR_CHAR; - break; - case DIR_RIGHT: - map[x++, y] = FLOOR_CHAR; - break; - default: - map[x, y] = FLOOR_CHAR; - break; - } - } - #endregion - - #region Horizontal & Vertial orthagonal pass - for (y = 0; y < height; ++y) { - for(x = 0; x < width; ++x) { - if (map[x, y].Equals(FLOOR_CHAR)) { - // Look left - if (map[x - 1, y].Equals(LEVEL_INIT_CHAR)) - map[x - 1, y] = Symbols.DBL_VERTICAL; - - // Look right - if (map[x + 1, y].Equals(LEVEL_INIT_CHAR)) - map[x + 1, y] = Symbols.DBL_VERTICAL; - - // Look up - if (map[x, y - 1].Equals(LEVEL_INIT_CHAR)) - map[x, y - 1] = Symbols.DBL_HORIZONTAL; - - // Look down - if (map[x, y + 1].Equals(LEVEL_INIT_CHAR)) - map[x, y + 1] = Symbols.DBL_HORIZONTAL; - } - } - } - #endregion - } - - /// - /// backing-store for the actual raw level data - /// without any sematic meaning(s) attached. - /// - char [, ] map; - - // The backing store for width and height. - int width, height; - - #region Quick private constants for level generation, - const char LEVEL_INIT_CHAR = ' '; - const char FLOOR_CHAR = '.'; - const string DIR_LEFT = "left"; - const string DIR_RIGHT = "right"; - const string DIR_UP = "up"; - const string DIR_DOWN = "down"; - const string TYPE_HALLWAY = "hallway"; - const string TYPE_ROOM = "room"; - #endregion - } -}*/ - -/* -if (File.Exists(aMapFileName)) - File.Delete(aMapFileName); - -aMapFileName = AsMapFileName(aMapFileName); - -try -{ - using (FileStream tmpRawStream = File.Open(aMapFileName, FileMode.OpenOrCreate)) - using (XmlTextWriter tmpXmlWriter = new XmlTextWriter(tmpRawStream, new UTF8Encoding())) - new XmlSerializer(typeof(DotNetHack.World.Tile[])).Serialize(tmpXmlWriter, mapData.ToArray()); -} -catch { }*/ \ No newline at end of file diff --git a/src/DotNetHack/Game/Effects/Effect.cs b/src/DotNetHack/Game/Effects/Effect.cs deleted file mode 100644 index 53a04a7..0000000 --- a/src/DotNetHack/Game/Effects/Effect.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Effects -{ - /// - /// The effect modifier delegate. - /// - /// The effect itself - /// the effect target - public delegate void EffectModifier(Effect effect, Actor target); - - /* - /// - /// AOEffectModifier - /// - /// The effect - /// The target location - public delegate void AOEffectModifier(Effect effect, Location3i target); - - /// - /// Area Effect - /// - public class AreaEffect : Effect - { - /// - /// Area of Effect - /// - /// - /// - /// - public AreaEffect(EffectType aEffectType, int aMagnitude, int aDuration = 1) - : base(aEffectType, aMagnitude, aDuration) - { } - } - */ - - /// - /// Effect - /// - [Serializable] - public class Effect - { - /// - /// Creates a new Effect. - /// - public Effect() { } - - /// - /// Creates a new instance of Effect - /// - /// The type of effect. - /// The magnitude. - /// The duration. - public Effect(EffectType aEffectType, int aMagnitude, int aDuration = 1) - : this(new StatsBase(0), aEffectType, aMagnitude, aDuration) { } - - /// - /// Creates a new instance of Effect - /// - /// The (initial) effect on stats. - /// The type of effect. - /// The magnitude. - /// The duration. - public Effect(StatsBase aStats, EffectType aEffectType, int aMagnitude, int aDuration = -1) - { - // set effected stats - EffectedStats = aStats; - - // Set the effect type. - EffectType = aEffectType; - - // Set the magnitude of this effect. - Magnitude = aMagnitude; - - // Set the duration of this effect. - Duration = aDuration; - - // new guid. - Guid = Guid.NewGuid(); - } - - /// - /// The duration of the affect. - /// - public int Duration { get; set; } - - /// - /// Magnitude - /// Magnitude is used as a variable during effects - /// computation for this effect. - /// a spell that gets stronger (or weaker) over time. - /// - public int Magnitude { get; set; } - - /// - /// Guid - /// - public Guid Guid { get; set; } - - /// - /// The Effect's type - /// - public EffectType EffectType { get; set; } - - /// - /// The effect modifier - /// - public EffectModifier EffectModifiers { get; set; } - - /// - /// The effect that this effect has on stats; this is assumed to be cumulative - /// for this effect. A "stack" of effects can expect to have each of these - /// commuted for the final combat calculation. - /// - /// - public StatsBase EffectedStats { get; set; } - - /// - /// The effect tick, exactly who this ticks on is important. - /// - /// The effected target(s) - public void Tick(Actor[] targets) - { -#if DEBUG - UI.Graphics.Display.ShowMessage("Type: {0}, Duration: {1}", - this.EffectType, this.Duration); -#endif - if (Duration > 0) - Duration--; - if (EffectModifiers != null && targets.Length > 0) - for (int index = 0; index < targets.Length; ++index) - if (targets[index] != null) - EffectModifiers(this, targets[index]); - } - - /// - /// The effect tick, exactly who this ticks on is important. - /// - /// the (single) target this ticks on - public void Tick(Actor target) - { - Tick(new Actor[] { target }); - } - - /// - /// PermanentDuration - /// - public const int PermanentDuration = -1; - } -} diff --git a/src/DotNetHack/Game/Effects/EffectType.cs b/src/DotNetHack/Game/Effects/EffectType.cs deleted file mode 100644 index 9455350..0000000 --- a/src/DotNetHack/Game/Effects/EffectType.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Effects -{ - /// - /// The intent for is that they are used in - /// conjuction with one another to create a flexible method for the - /// implementation of various effects without mindnumbing indirection. - /// - /// - /// Here is a what a sleep spell light look like, - /// Spell | Sleep - /// - /// A lightning bolt from the sky would be, - /// Nature | Electric - /// - /// A worn amulet that enhances stats might be, - /// Enchantment - /// - /// A disease that blinds and slowly drains health. - /// Blind | Drain | Disease - /// - /// A basic healing spell. - /// Healing | Spell - /// - /// - /// It is very tempting to add various schools, destruction, restoration, etc. But - /// there isn't yet a *reason* to do so. This will have to do for now. - /// - /// Combining these are not intented to reflect multiple effects. - /// Rather, the combination of these lead to a single effect. - /// - [Flags] - public enum EffectType - { - Hallucination, - Disintergate, - Enchantment, - Polymorph, - Physical, - Electric, - Confused, - Crippled, - Healing, - Poision, - Disease, - Arcane, - Shadow, - Nature, - Frenzy, - Hunger, - Sleep, - Blind, - Drain, - Spell, - Frost, - Stun, - Acid, - Fire, - Holy, - Fear, - } -} diff --git a/src/DotNetHack/Game/Effects/Effects.cd b/src/DotNetHack/Game/Effects/Effects.cd deleted file mode 100644 index cde7490..0000000 --- a/src/DotNetHack/Game/Effects/Effects.cd +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - AAAAAAAAAAACAAAAAAAAAACAAAAAAAAAAAAAAAAAAAA= - Game\Effects\Effect.cs - - - - - - - - - AAAAgAACAAAEAAAAEQAAAAAQAABEAAIAAAAAAAQAAAA= - Game\Effects\EffectType.cs - - - - \ No newline at end of file diff --git a/src/DotNetHack/Game/Events/ActorEventArgs.cs b/src/DotNetHack/Game/Events/ActorEventArgs.cs deleted file mode 100644 index 65759a1..0000000 --- a/src/DotNetHack/Game/Events/ActorEventArgs.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Events -{ - /// - /// ActorEventArgs - /// - public abstract class ActorEventArgs : GameEventArgs - { - /// - /// Creates a new actor event - /// - /// - public ActorEventArgs(Actor aActor) - { - ActorInvolved = aActor; - } - - /// - /// Actor involved in the event. - /// - public Actor ActorInvolved { get; set; } - } - -} diff --git a/src/DotNetHack/Game/Events/ArmourEventArgs.cs b/src/DotNetHack/Game/Events/ArmourEventArgs.cs deleted file mode 100644 index 4f945a4..0000000 --- a/src/DotNetHack/Game/Events/ArmourEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Events -{ - /// - /// ArmourEventArgs - /// - public class ArmourEventArgs : GameEventArgs - { - /// - /// ArmourEventArgs - /// - /// The armour involved in this armour event - public ArmourEventArgs(Actor aActor, IArmour aArmour) - { Armour = aArmour; WornByActor = aActor; } - - /// - /// The armour involved in this armour event - /// - public IArmour Armour { get; set; } - - /// - /// Actor - /// - public Actor WornByActor { get; set; } - } - - /// - /// ArmourEventArgs - /// - public class ArmourStrikeEventArgs : ArmourEventArgs - { - /// - /// ArmourStrikeEventArgs - /// - /// The actor doing the wearing of this armour piece - /// The actor doing the attacking - /// The armour piece involved. - public ArmourStrikeEventArgs(Actor aWornByActor, Actor aAttackingActor, IArmour aArmour) - : base(aWornByActor, aArmour) { AttackingActor = aAttackingActor; } - - /// - /// Attacking actor. - /// - public Actor AttackingActor { get; set; } - } -} diff --git a/src/DotNetHack/Game/Events/DNHExceptionEventArgs.cs b/src/DotNetHack/Game/Events/DNHExceptionEventArgs.cs deleted file mode 100644 index 04909a1..0000000 --- a/src/DotNetHack/Game/Events/DNHExceptionEventArgs.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Events -{ - /// - /// DNH Exception event arguments - /// - public class DNHackExceptionEventArgs : EventArgs - { - /// - /// Creates a new instace of DNH exception event args - /// - /// - public DNHackExceptionEventArgs(DNHackException ex) - : base() - { DNHackException = ex; } - - /// - /// The exception that was involved - /// - public DNHackException DNHackException { get; set; } - } -} diff --git a/src/DotNetHack/Game/Events/DoorEventArgs.cs b/src/DotNetHack/Game/Events/DoorEventArgs.cs deleted file mode 100644 index a7fe39a..0000000 --- a/src/DotNetHack/Game/Events/DoorEventArgs.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Dungeon.Tiles; - -namespace DotNetHack.Game.Events -{ - /// - /// DoorEventArgs - /// - public class DoorEventArgs : ActorEventArgs - { - public DoorEventArgs(Actor aActor, Door aDoor) - : base(aActor) { DoorInvolved = aDoor; } - - public Door DoorInvolved { get; set; } - } -} diff --git a/src/DotNetHack/Game/Events/EquipmentEventArgs.cs b/src/DotNetHack/Game/Events/EquipmentEventArgs.cs deleted file mode 100644 index 75b5cd2..0000000 --- a/src/DotNetHack/Game/Events/EquipmentEventArgs.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Events -{ - /// - /// potion event args - /// - /// - public class PotionEventArgs : ActorEventArgs - { - /// - /// creates a new potion event args - /// - /// - public PotionEventArgs(Actor aActor, IPotion aPotion) - : base(aActor) - { PotionInvolved = aPotion; } - - /// - /// the potion involved - /// - public IPotion PotionInvolved { get; set; } - } - - /// - /// equipment based event argument - /// - /// the special event type - /// the equipment iteself - public class EquipmentEventArgs : GameEventArgs - where G: IEquipment - { - /// - /// Creates a new EquipmentEventArgs - /// - /// The special event type - /// The equipment that is involved - public EquipmentEventArgs(T aType, G aEquipmentInvoled) - { - EquipmentInvolved = aEquipmentInvoled; - EquipEventType = aType; - } - - /// - /// the peice of equipment involved - /// - public G EquipmentInvolved { get; set; } - - /// - /// EquipEventType - /// - public T EquipEventType { get; set; } - } -} diff --git a/src/DotNetHack/Game/Events/GameEventArgs.cs b/src/DotNetHack/Game/Events/GameEventArgs.cs deleted file mode 100644 index f56c992..0000000 --- a/src/DotNetHack/Game/Events/GameEventArgs.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Events -{ - /// - /// GameEvent - /// EventArgs should have as much context as required for - /// event subscribers to act appropriately. - /// - public class GameEventArgs : EventArgs - { - /// - /// Creates a new instance of - /// - public GameEventArgs() : base() { } - } -} diff --git a/src/DotNetHack/Game/Events/KeyPressEventArgs.cs b/src/DotNetHack/Game/Events/KeyPressEventArgs.cs deleted file mode 100644 index afadfe2..0000000 --- a/src/DotNetHack/Game/Events/KeyPressEventArgs.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Events -{ - public class KeyPressEventArgs : GameEventArgs - { - public KeyPressEventArgs(ConsoleKeyInfo aConsoleKeyInfo) - { - ConsoleKeyInfo = aConsoleKeyInfo; - } - - ConsoleKeyInfo ConsoleKeyInfo { get; set; } - } -} diff --git a/src/DotNetHack/Game/Events/MoveEventArgs.cs b/src/DotNetHack/Game/Events/MoveEventArgs.cs deleted file mode 100644 index 3848f14..0000000 --- a/src/DotNetHack/Game/Events/MoveEventArgs.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using DotNetHack.Game.Dungeon.Tiles; - -namespace DotNetHack.Game.Events -{ - /// - /// actor movement event arguments - /// - public class MoveEventArgs : ActorEventArgs - { - /// - /// creates a new instance of actor movement event - /// - /// the actor - /// source tile - /// dest tile - public MoveEventArgs(Actor aActor, Tile aMoveFrom, Tile aMoveTo) - : base(aActor) - { - MoveFromTile = aMoveFrom; - MoveToTile = aMoveTo; - } - - /// - /// the tile that the actor moved to - /// - public Tile MoveToTile { get; set; } - - /// - /// sometimes is not where you are, it's where you came from. - /// - public Tile MoveFromTile { get; set; } - } -} diff --git a/src/DotNetHack/Game/Events/SoundEvent.cs b/src/DotNetHack/Game/Events/SoundEvent.cs deleted file mode 100644 index a0ee656..0000000 --- a/src/DotNetHack/Game/Events/SoundEvent.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Events -{ - /// - /// SoundEventArgs - /// If a tree falls in the forest does anyone hear it? - /// - public class SoundEventArgs : GameEventArgs, IHasLocation - { - /// - /// Create a new instance of sound event arguments - /// - /// - public SoundEventArgs(Sound aSound) { Sound = aSound; } - - /// - /// The sound tied to this event. - /// - public Sound Sound { get; set; } - - /// - /// Decibels - /// - public int Decibels { get { return Sound.SoundDecibels; } } - - /// - /// The description of the sound. - /// - public string Description { get { return Sound.SoundDescription; } } - - /// - /// The location of the sound. - /// - public Location3i Location - { - get { return Sound.Location; } - set { Sound.Location = value; } - } - } -} diff --git a/src/DotNetHack/Game/Events/WeaponEvent.cs b/src/DotNetHack/Game/Events/WeaponEvent.cs deleted file mode 100644 index 8f003a0..0000000 --- a/src/DotNetHack/Game/Events/WeaponEvent.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Events -{ - /// - /// WeaponEvent - /// - public class WeaponEventArgs : GameEventArgs - { - /// - /// WeaponEvent - /// - public WeaponEventArgs(IWeapon aWeapon) { Weapon = aWeapon; } - - /// - /// The weapon involved in the weapon event - /// - IWeapon Weapon { get; set; } - } -} diff --git a/src/DotNetHack/Game/GameEngine.cs b/src/DotNetHack/Game/GameEngine.cs deleted file mode 100644 index f285e2e..0000000 --- a/src/DotNetHack/Game/GameEngine.cs +++ /dev/null @@ -1,608 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using DotNetHack; -using DotNetHack.UI; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Dungeon; -using DotNetHack.Game.Dungeon.Tiles; -using DotNetHack.Game.Items; -using DotNetHack.Game.Dungeon.Tiles.Traps; -using DotNetHack.Game.NPC.Monsters; -using System.Xml.Serialization.Persisted; -using DotNetHack.Game.Actions; -using DotNetHack.Game.Items.Equipment.Weapons; -using DotNetHack.Game.Events; -using System.IO; -using System.Threading; -using DotNetHack.Game.NPC; -using DotNetHack.UI.Windows; -using DotNetHack.Utility.Media; - -namespace DotNetHack.Game -{ - /// - /// Movement command delegate - /// - /// The unit movement - /// true if the movement was sucessful - public delegate bool ProcessCommand(ConsoleKeyInfo input); - - /// - /// Action commands are fired if and only if the player can act. - /// - /// - /// - public delegate DAction ActionCommand(ConsoleKeyInfo input); - - /// - /// GameEngine - /// - public partial class GameEngine : IDisposable - { - /// - /// GameEngine - /// - /// - public GameEngine(Player aPlayer, Dungeon3 aStartDungeon) - { - Time = 0L; - Player = aPlayer; - CurrentMap = aStartDungeon; - - // TODO: more junk - foreach (var m in aStartDungeon.NonPlayerControlled) - m.WieldedWeapons.CurrentWeapon = new ShortswordOfRending(null); - } - - /// - /// - /// - public static volatile bool Done = false; - - /// - /// - /// - TargetSelector TargetSelect = null; - - /// - /// Excecutes the game engine until !done. - /// - /// Pass various flags to the game engine to - /// adjust context, perform tests, etc. - /// The same args from entry point (ref) - public void Run(EngineRunFlags aFlags, ref string[] args) - { - GameEngine.RunFlags = aFlags; - - try - { - Initialize(); - - ThreadPool.QueueUserWorkItem(delegate(object o) - { - while (!Done) - { - CurrentMap.IterateDungeonData(delegate(int x, int y, int d) - { - var t = CurrentMap.GetTile(x, y, d); - if (t.TileType.Equals(TileType.Water)) - { - if (Dice.D(20)) - switch (t.G) - { - default: - t.G = Symbols.ALMOST_EQUAL; - break; - case Symbols.ALMOST_EQUAL: - t.G = '~'; - break; - case '~': - t.G = Symbols.ALMOST_EQUAL; - break; - } - if (Dice.D(20)) - switch (t.C.BG) - { - case ConsoleColor.DarkBlue: - t.C.BG = ConsoleColor.Blue; - break; - case ConsoleColor.Blue: - t.C.BG = ConsoleColor.DarkBlue; - break; - } - } - - }); - - //CurrentMap.Render(Player.Location); - //Player.Draw(); - //UI.Graphics.Display.ShowStatsBar(Player); - Thread.Sleep(1300); - } - }); - - while (!Done) - { - Graphics.CursorToLocation(0, 0); - - var input = Console.ReadKey(true); - - if (!ProcessCommand(input)) - continue; - - TargetSelect = null; - - // TODO: Make a distintion between action(s) - // and general commands. ProcessAction(input); - - if (OnTick != null) - OnTick(null, new EventArgs()); - - Update(); - - CurrentMap.Render(Player.Location); - - UI.Graphics.Display.ShowStatsBar(Player); - - Player.Draw(); - - Thread.Sleep(10); - } - } - catch (Exception ex) - { - if (OnException != null) - OnException(this, new ErrorEventArgs(ex)); - } - finally { Dispose(); } - } - - /// - /// processes all incoming commands and triggers associated actions and events. - /// - /// raw input - /// - bool ProcessCommand(ConsoleKeyInfo input) - { - bool isMoveCommand = false; - bool isTargetCommand = false; - - Func aRestriction = null; - - Tile nMoveFrom = CurrentMap.GetTile(Player); - Tile nMoveTo = null; - - Location3i UnitMovement = new Location3i(0, 0, 0); - - switch (input.Key) - { - case ConsoleKey.LeftArrow: - isMoveCommand = true; - UnitMovement.X--; break; - case ConsoleKey.RightArrow: - isMoveCommand = true; - UnitMovement.X++; break; - case ConsoleKey.UpArrow: - isMoveCommand = true; - UnitMovement.Y--; break; - case ConsoleKey.DownArrow: - isMoveCommand = true; - UnitMovement.Y++; break; - case ConsoleKey.OemPeriod: - if (input.Modifiers == ConsoleModifiers.Shift) - { - isMoveCommand = true; - aRestriction = new Func( - x => x.TileType == TileType.StairsDown); - UnitMovement.D--; - } break; - case ConsoleKey.OemComma: - if (input.Modifiers == ConsoleModifiers.Shift) - { - isMoveCommand = true; - aRestriction = new Func( - x => x.TileType == TileType.StairsUp); - UnitMovement.D++; - } - else - { - var t = CurrentMap.GetTile(Player); - - foreach (IItem k in t.Items.Where(i => i.ItemType == ItemType.Key)) - Player.KeyChain.AddKey((IKey)k); - foreach (IKey k in Player.KeyChain.KeyStore) - t.Items.Remove((IItem)k); - - /* - if (t.TileFlags == TileFlags.Spawn) - { - var tmpHerbSpawn = ((HerbSpawn)t); - var resource = tmpHerbSpawn.Take(); - if (resource != null) - Player.Inventory.Add(resource); - else UI.Graphics.Display.ShowMessage("Maybe come back later?"); - }*/ - - // TODO: move this - DAction a = new ActionPickup(Player, - CurrentMap.GetTile(Player).Items); - a.Perform(); - } - - break; - - case ConsoleKey.P: - { - Player.WornArmour.PutOn( - Player.Inventory.Armour.First(), true); - break; - } - case ConsoleKey.W: - { - Player.WieldedWeapons.Wield( - Player.Inventory.Weapons.First(), true); - break; - } - case ConsoleKey.Q: - { - var potion = Player.Inventory.Potions.First(); - if (potion != null) - potion.Quaff(Player); - break; - } - case ConsoleKey.Tab: - isTargetCommand = true; - if (TargetSelect == null) - TargetSelect = new TargetSelector( - CurrentMap.NonPlayerControlled.Where( - n => n.Distance(Player) < 10)); - if (TargetSelect.HasTargets) - { - var currentTarget = TargetSelect.NextTarget(); - var currentTargetLocation = currentTarget.Location; - char currentSymbol = currentTarget.G; - UI.Graphics.CursorToLocation(currentTargetLocation); - Console.BackgroundColor = ConsoleColor.DarkRed; - Graphics.CursorToLocation(currentTargetLocation); - Console.Write(currentSymbol); - } - - break; - - case ConsoleKey.I: - WindowInventory inventoryWindow = - new WindowInventory(Player); - inventoryWindow.Show(); - CurrentMap.DungeonRenderer.HardRefresh(Player.Location); - break; - - case ConsoleKey.C: - - // create a new character sheet for the player - WindowCharacterSheet characterSheet = - new WindowCharacterSheet(Player); - - characterSheet.Show(); - CurrentMap.DungeonRenderer.HardRefresh(Player.Location); - - break; - - case ConsoleKey.O: - { - Door tmpDoor; - if (TryOpenCloseDoor(Player, Input.GetDirection(), out tmpDoor)) - { - if (OnDoorOpenedClosed != null) - OnDoorOpenedClosed(this, new DoorEventArgs(Player, tmpDoor)); - } - } break; - case ConsoleKey.Escape: - Done = true; - break; - } - - if (isTargetCommand) - return false; - - if (isMoveCommand) - if (TryMove(Player, Player.Location + UnitMovement, out nMoveTo, aRestriction)) - { - if (OnPlayerMoved != null) - OnPlayerMoved(this, new MoveEventArgs(Player, nMoveFrom, nMoveTo)); - } - else - { - NPC.NonPlayerControlled tmpNPC = CurrentMap.GetNPC( - Player.Location + UnitMovement); - if (tmpNPC != null) - new ActionMeleeAttack(Player, tmpNPC).Perform(); - } - - return true; - } - - public ActionCommand ProcessAction(ConsoleKeyInfo input) - { - return null; - } - - /// - /// Occurs when errors are thrown. - /// - public event ErrorEventHandler OnException; - - /// - /// Occurs specifically when a player moves onto a new tile. - /// - public event EventHandler OnPlayerMoved; - - /// - /// Occurs when any actor, including the play moves onto a new tile. - /// - public event EventHandler OnActorMoved; - - /// - /// occurs when *any* door is opended or closed. - /// - public event EventHandler OnDoorOpenedClosed; - - /// - /// Occurs when DoSound is called. - /// - public static event EventHandler OnSound; - - /// - /// Tick - /// - public static event EventHandler OnTick; - - /// - /// load monsters, weapons, potions. - /// - public bool Initialize() - { - OnActorMoved += new EventHandler(GameEngine_OnActorMoved); - OnPlayerMoved += new EventHandler(GameEngine_OnPlayerMoved); - OnException += new ErrorEventHandler(GameEngine_OnException); - OnTick += new EventHandler(GameEngine_OnTick); - - try { MonsterStore = Persisted.Read>(R.MonsterFile); } - catch { return false; } - - SoundController.Instance.Initialize(); - - return true; - } - - /// - /// GameEngine_OnTick - /// - /// OnShow sender - /// OnShow args - void GameEngine_OnTick(object sender, EventArgs e) - { - Time++; - } - - /// - /// triggered when any actor moves to a *different* tile. - /// - /// - triggers traps, - /// ... - /// - triggers clear/rerender of location. - /// - /// - /// the event sender - /// the move event argument. - void GameEngine_OnActorMoved(object sender, MoveEventArgs e) - { - if (e.MoveToTile.TileFlags == TileFlags.Trap) - ((Trap)e.MoveToTile).OnTrapTriggeredEvent(new Trap.TrapEventArgs(e.ActorInvolved)); - - CurrentMap.DungeonRenderer.ClearLocation(Player.Location); - } - - /// - /// occurs specifically when the player moves to a new tile - /// used generally for diplay and ui purposes. - /// - /// the event sender - /// the event argument - void GameEngine_OnPlayerMoved(object sender, MoveEventArgs e) - { - if ((e.MoveToTile.TileFlags & TileFlags.Trap) == TileFlags.Trap) - // if (e.MoveToTile.TileFlags.HasFlag(TileFlags.Trap)) - { - Trap t = ((Trap)e.MoveToTile); - - t.OnTrapTriggeredEvent(new Trap.TrapEventArgs(Player)); - } - else if (e.MoveToTile.HasItems) - { - if (e.MoveToTile.Items.Count == 1) - UI.Graphics.Display.ShowMessage(e.MoveToTile.Items.First().Name); - else - UI.Graphics.Display.ShowMessage("{0}, {1} here", - e.MoveToTile.Items.Count, - Speech.Pluralize("item", e.MoveToTile.Items.Count)); - } - else if ((e.MoveFromTile.TileFlags & TileFlags.Spawn) == TileFlags.Spawn) - { - var tmpHerbSpawn = (HerbSpawn)e.MoveFromTile; - UI.Graphics.Display.ShowMessage(tmpHerbSpawn.Resource.Name); - } - } - - /// - /// Occurs when an exception is caught. - /// - /// - /// - void GameEngine_OnException(object sender, ErrorEventArgs ex) - { - UI.Graphics.MessageBox.Show("DNH Exception", ex.GetException()); - ex.GetException().Write(R.ExceptionFile); - } - - /// - /// Cleanup after the game-engine runs. - /// - public void Dispose() - { - GameEngine.OnSound = null; - GameEngine.OnTick = null; - GameEngine.Time = 0; - Done = true; - } - - /// - /// Try to open what *may* be a door at the given location. - /// in the event there is a door the out param is populated. - /// - /// the actor opening the door - /// the door location - /// true if the door has been opened. - public bool TryOpenCloseDoor(Actor aActor, Location3i aLocation, out Door tmpDoor) - { - tmpDoor = null; - - if (!CurrentMap.CheckBounds(aActor.Location + aLocation)) - return false; - - tmpDoor = (Door)CurrentMap.GetTile(aActor.Location + aLocation); - - if (tmpDoor.TileFlags == TileFlags.Door) - { - if (!tmpDoor.IsLocked) - { - if (tmpDoor.IsOpen) - tmpDoor.CloseDoor(); - else tmpDoor.OpenDoor(); - } - else - { - if (Player.KeyChain.CanUnLock(tmpDoor)) - { - if (tmpDoor.IsOpen) - tmpDoor.CloseDoor(); - else tmpDoor.OpenDoor(); - } - else return false; - } - } - - return true; - } - - /// - /// - check the boundary ? return false - /// - get the tile (set as out) - /// - check the clipping ? return false - /// - change actor location - /// - return true - /// in the event the tile is invalid, expect oMoveToTile to be null. - /// - /// the aObject being moved - /// the location the actor is moving to - /// the tile the actor moved to. (out) - /// true on success - private bool TryMove(IHasLocation aObject, Location3i aLocation, - out Tile oMoveToTile, Func aPredicate = null) - { - oMoveToTile = null; - - if (!CurrentMap.CheckBounds(aLocation)) - return false; - - oMoveToTile = CurrentMap.GetTile(aLocation); - - if (oMoveToTile == null) - return false; - else if (oMoveToTile.Impassable) - return false; - - if (aPredicate != null) - if (!aPredicate(oMoveToTile)) - return false; - - if (!CurrentMap.IsPassable(aLocation)) - return false; - - aObject.Location = aLocation; - - return true; - } - - /// - /// performs various stateful updates to game objects. - /// - public void Update() - { - // Perform regeneration step for player. - Player.RegenerateHealth(); - Player.RegenerateMagika(); - Player.ApplyEffects(); - - - // Remove all NPC's that are dead, then run the ones that aren't (yet). - CurrentMap.NonPlayerControlled.RemoveAll(x => x.Dead); - foreach (var npc in CurrentMap.NonPlayerControlled) - { - npc.ApplyEffects(); - npc.Execute(Player); - } - } - - /// - /// DoSound, generates a sound. Calls subscribed listeners. - /// - /// The sound that is generated. - public static void DoSound(Sound aSound) - { - if (OnSound != null) - OnSound(null, new SoundEventArgs(aSound)); - } - - /// - /// Time - /// - public static long Time { get; private set; } - - /// - /// Player - /// - public static Player Player { get; private set; } - - /// - /// - /// - public enum TimeScale - { - World, Dungeon, - } - - /// - /// CurrentMap - /// - private Dungeon3 CurrentMap { get; set; } - - /// - /// RunFlags - /// - public static EngineRunFlags RunFlags { get; set; } - - /// - /// MonsterStore - /// - public static List MonsterStore { get; set; } - - /// - /// EngineRunFlags - /// - [Flags] - public enum EngineRunFlags { Normal, Editor, Debug } - } -} diff --git a/src/DotNetHack/Game/Glyph.cs b/src/DotNetHack/Game/Glyph.cs deleted file mode 100644 index 4c6fd35..0000000 --- a/src/DotNetHack/Game/Glyph.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; - -namespace DotNetHack.Game -{ - /// - /// A glyph is the combination of a symbol and a colour. - /// - /// The Glyph object is intended to replace multiple occurances - /// of the Char and Colour combination present throughout multiple DNH - /// object classes. - /// - /// - public class Glyph - { - /// - /// Parameterless constructor supports serialization. - /// - public Glyph() - { - G = '\0'; // nil - C = Colour.Standard; // nil - } - - /// - /// Creates a new glyph with the symbol g - /// Colour.Standard - /// - public Glyph(char g) - : this(g, Colour.Standard) - { } - - /// - /// Creates a new Glyph with the passed symbol and colour. - /// - public Glyph(char g, Colour c) - { - G = g; // set the symbol - C = c; // set the colour./ - } - - /// - /// The symbol for the glyph. - /// - public char G { get; set; } - - /// - /// The colour of the glyph. - /// - public Colour C { get; set; } - } -} diff --git a/src/DotNetHack/Game/Interfaces/IArmor.cs b/src/DotNetHack/Game/Interfaces/IArmor.cs deleted file mode 100644 index 293fb4f..0000000 --- a/src/DotNetHack/Game/Interfaces/IArmor.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Items.Equipment.Armour; -using DotNetHack.Game.Items.Equipment.Armor; -using DotNetHack.Game.Events; - -namespace DotNetHack.Game.Interfaces -{ - public interface IArmour : IEquipment, IHasCondition - { - ArmourLocation ArmourLocation { get; } - StatsBase StatsBase { get; set; } - ArmourStats ArmourStats { get; set; } - event EventHandler OnMeleeStrike; - event EventHandler OnSpellStrike; - void ArmourStrike(ArmourStrikeEventArgs args); - } -} diff --git a/src/DotNetHack/Game/Interfaces/ICanBeEffected.cs b/src/DotNetHack/Game/Interfaces/ICanBeEffected.cs deleted file mode 100644 index af4bb07..0000000 --- a/src/DotNetHack/Game/Interfaces/ICanBeEffected.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using DotNetHack.Game.Effects; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// Interface that - /// - public interface ICanBeEffected - { - /// - /// ApplyEffects - /// - void ApplyEffects(); - - /// - /// the effect stack. - /// - List EffectStack { get; set; } - } - - /// - /// ICanBeEffectedExplicit - /// - /// - public interface ICanBeEffectedExplicit : ICanBeEffected - { - /// - /// Target - /// - T Target { get; set; } - } -} diff --git a/src/DotNetHack/Game/Interfaces/ICanDrink.cs b/src/DotNetHack/Game/Interfaces/ICanDrink.cs deleted file mode 100644 index 03092f5..0000000 --- a/src/DotNetHack/Game/Interfaces/ICanDrink.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// For anything that can drink - /// - public interface ICanDrink - { - /// - /// Drinks a potion. - /// - /// The potion being drank. - void Quaff(IPotion aPotion); - } -} diff --git a/src/DotNetHack/Game/Interfaces/IConsumable.cs b/src/DotNetHack/Game/Interfaces/IConsumable.cs deleted file mode 100644 index a2d828f..0000000 --- a/src/DotNetHack/Game/Interfaces/IConsumable.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - /// - /// IConsumable - /// - public interface IConsumable : IItem - { - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IDrawable.cs b/src/DotNetHack/Game/Interfaces/IDrawable.cs deleted file mode 100644 index 6fde311..0000000 --- a/src/DotNetHack/Game/Interfaces/IDrawable.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - public interface IDrawable : IGlyph, IHasLocation - { - void Draw(); - } - - /// - /// IRender - /// - public interface IRender : IHasLocation - { - - } -} diff --git a/src/DotNetHack/Game/Interfaces/IEquipment.cs b/src/DotNetHack/Game/Interfaces/IEquipment.cs deleted file mode 100644 index 43f8761..0000000 --- a/src/DotNetHack/Game/Interfaces/IEquipment.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - /// - /// IEquipment - /// - public interface IEquipment : IItem - { - } -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Interfaces/IFood.cs b/src/DotNetHack/Game/Interfaces/IFood.cs deleted file mode 100644 index eb5bfc5..0000000 --- a/src/DotNetHack/Game/Interfaces/IFood.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - /// - /// IFood - /// - public interface IFood : IConsumable - { - /// - /// The number of calories of this food-stuff. - /// - int Calories { get; set; } - - /// - /// If this food tainted - /// - bool Tainted { get; set; } - - /// - /// Eat this food - /// - void Eat(); - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IGlyph.cs b/src/DotNetHack/Game/Interfaces/IGlyph.cs deleted file mode 100644 index e1ea981..0000000 --- a/src/DotNetHack/Game/Interfaces/IGlyph.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using DotNetHack.UI; -namespace DotNetHack.Game.Interfaces -{ - /// - /// IGlyph - /// - public interface IGlyph - { - char G { get; set; } - - Colour C { get; set; } - } -} diff --git a/src/DotNetHack/Game/Interfaces/IHasCharges.cs b/src/DotNetHack/Game/Interfaces/IHasCharges.cs deleted file mode 100644 index 28b21a2..0000000 --- a/src/DotNetHack/Game/Interfaces/IHasCharges.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - public interface IHasCharges - { - int ChargesRemaining { get; set; } - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IHasCondition.cs b/src/DotNetHack/Game/Interfaces/IHasCondition.cs deleted file mode 100644 index 0fc4248..0000000 --- a/src/DotNetHack/Game/Interfaces/IHasCondition.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - public interface IHasCondition - { - int Condition { get; set; } - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IHasLocation.cs b/src/DotNetHack/Game/Interfaces/IHasLocation.cs deleted file mode 100644 index e2702dd..0000000 --- a/src/DotNetHack/Game/Interfaces/IHasLocation.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// IHasLocation is used to mark things or objects that are locatable in 2-space. - /// - public interface IHasLocation - { - /// - /// Location - /// - Location3i Location { get; set; } - } -} diff --git a/src/DotNetHack/Game/Interfaces/IHasUses.cs b/src/DotNetHack/Game/Interfaces/IHasUses.cs deleted file mode 100644 index 99f0e01..0000000 --- a/src/DotNetHack/Game/Interfaces/IHasUses.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - public interface IHasUses - { - int UsesRemaining { get; set; } - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IIngredient.cs b/src/DotNetHack/Game/Interfaces/IIngredient.cs deleted file mode 100644 index a5c026b..0000000 --- a/src/DotNetHack/Game/Interfaces/IIngredient.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - public interface IIngredient { string Name { get; set; } } - -} diff --git a/src/DotNetHack/Game/Interfaces/IItem.cs b/src/DotNetHack/Game/Interfaces/IItem.cs deleted file mode 100644 index 559dcda..0000000 --- a/src/DotNetHack/Game/Interfaces/IItem.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// IItem - /// - public interface IItem : IDrawable - { - string Name { get; set; } - ItemType ItemType { get; set; } - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IKey.cs b/src/DotNetHack/Game/Interfaces/IKey.cs deleted file mode 100644 index 345103b..0000000 --- a/src/DotNetHack/Game/Interfaces/IKey.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - public interface IKey - { - Guid KeyGuid { get; set; } - } - - public interface IHasLock - { - bool UnLock(IKey aKey); - Guid KeyRef { get; set; } - } -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Interfaces/IMagical.cs b/src/DotNetHack/Game/Interfaces/IMagical.cs deleted file mode 100644 index c67efbf..0000000 --- a/src/DotNetHack/Game/Interfaces/IMagical.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - public interface IMagical : IItem - { - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IMonster.cs b/src/DotNetHack/Game/Interfaces/IMonster.cs deleted file mode 100644 index 3178eb5..0000000 --- a/src/DotNetHack/Game/Interfaces/IMonster.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - public interface IMonster : IDrawable - { - string Name { get; set; } - } -} diff --git a/src/DotNetHack/Game/Interfaces/IPotion.cs b/src/DotNetHack/Game/Interfaces/IPotion.cs deleted file mode 100644 index 8d26b47..0000000 --- a/src/DotNetHack/Game/Interfaces/IPotion.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using DotNetHack.Game.Items.Potions; -namespace DotNetHack.Game.Interfaces -{ - /// - /// IPotion - /// - public interface IPotion : IConsumable - { - /// - /// The type of the potion - /// - PotionType PotionType { get; set; } - - /// - /// The quaff - /// - void Quaff(Actor aTarget); - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IPrayer.cs b/src/DotNetHack/Game/Interfaces/IPrayer.cs deleted file mode 100644 index 19a6850..0000000 --- a/src/DotNetHack/Game/Interfaces/IPrayer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// IPrayer - /// - public interface IPrayer { } -} diff --git a/src/DotNetHack/Game/Interfaces/IReadable.cs b/src/DotNetHack/Game/Interfaces/IReadable.cs deleted file mode 100644 index fe80172..0000000 --- a/src/DotNetHack/Game/Interfaces/IReadable.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - public interface IReadable - { - void Read(); - } -} - diff --git a/src/DotNetHack/Game/Interfaces/IScroll.cs b/src/DotNetHack/Game/Interfaces/IScroll.cs deleted file mode 100644 index 7584990..0000000 --- a/src/DotNetHack/Game/Interfaces/IScroll.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System; -namespace DotNetHack.Game.Interfaces -{ - public interface IScroll : IMagical, IHasCharges, IReadable - { - } -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Interfaces/ISpawn.cs b/src/DotNetHack/Game/Interfaces/ISpawn.cs deleted file mode 100644 index f7d5347..0000000 --- a/src/DotNetHack/Game/Interfaces/ISpawn.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// ISpawn - /// - public interface ISpawn where T : IItem - { - /// - /// The last time this spawn was visited. - /// - long TicksSinceLastVisited { get; set; } - - /// - /// The resource that is spawned by this spawn. - /// - T Resource { get; set; } - - /// - /// The location of this spawn. - /// - Location3i Location { get; set; } - - /// - /// Take this resource from the spawn. - /// - /// The resource or default(T) - T Take(); - - /// - /// CanTake - /// - bool CanTake { get; } - } -} diff --git a/src/DotNetHack/Game/Interfaces/ITome.cs b/src/DotNetHack/Game/Interfaces/ITome.cs deleted file mode 100644 index 1705099..0000000 --- a/src/DotNetHack/Game/Interfaces/ITome.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - public interface ITome : IMagical, IReadable { } -} diff --git a/src/DotNetHack/Game/Interfaces/ITool.cs b/src/DotNetHack/Game/Interfaces/ITool.cs deleted file mode 100644 index e44caf2..0000000 --- a/src/DotNetHack/Game/Interfaces/ITool.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// ITool - /// - public interface ITool : IItem, IHasUses - { - void Use(); - void Apply(IItem[] items); - } -} diff --git a/src/DotNetHack/Game/Interfaces/IWand.cs b/src/DotNetHack/Game/Interfaces/IWand.cs deleted file mode 100644 index c795744..0000000 --- a/src/DotNetHack/Game/Interfaces/IWand.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Interfaces -{ - public interface IWand : IHasCharges, IMagical { } -} diff --git a/src/DotNetHack/Game/Interfaces/IWeapon.cs b/src/DotNetHack/Game/Interfaces/IWeapon.cs deleted file mode 100644 index 373aafc..0000000 --- a/src/DotNetHack/Game/Interfaces/IWeapon.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using DotNetHack.Game.Items.Equipment; -using DotNetHack.Game.Items.Equipment.Weapons; -namespace DotNetHack.Game.Interfaces -{ - /// - /// IWeapon - /// - public interface IWeapon : IEquipment, IHasCondition - { - /// - /// the worn (or not) location of this weapon. - /// - WeaponLocation WeaponLocation { get; set; } - - /// - /// the intrinsic properties of this weapon. - /// - WeaponProperties WeaponProperties { get; set; } - - /// - /// more information about the type of weapon. - /// this pretains to usage. - /// - WeaponSubType WeaponSubType { get; set; } - - /// - /// the type of weapon this is - /// - WeaponType WeaponType { get; set; } - - /// - /// - /// - /// - /// - bool HasSubTypeFlag(WeaponSubType aWeaponSubType); - } -} - diff --git a/src/DotNetHack/Game/Interfaces/Interfaces.cd b/src/DotNetHack/Game/Interfaces/Interfaces.cd deleted file mode 100644 index 2bbbc12..0000000 --- a/src/DotNetHack/Game/Interfaces/Interfaces.cd +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IWeapon.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IConsumable.cs - - - - - - AAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IDrawable.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IDrawable.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IEquipment.cs - - - - - - AAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IFood.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAA= - Game\Interfaces\IGlyph.cs - - - - - - AAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IHasCharges.cs - - - - - - AAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IHasCondition.cs - - - - - - AAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IHasLocation.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAA= - Game\Interfaces\IHasUses.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IItem.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IMagical.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAA= - Game\Interfaces\IPotion.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IReadable.cs - - - - - - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IScroll.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\ITome.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IWand.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IArmor.cs - - - - - - AAAAAAAAABAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= - Game\Interfaces\ITool.cs - - - - \ No newline at end of file diff --git a/src/DotNetHack/Game/Items/Containers/LockBox.cs b/src/DotNetHack/Game/Items/Containers/LockBox.cs deleted file mode 100644 index 69a1adc..0000000 --- a/src/DotNetHack/Game/Items/Containers/LockBox.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Items.Containers -{ - /// - /// LockBox - /// - public class LockBox : LootContainer - { - /// - /// LockBox - /// - /// Is this lockbox actually locked? - public LockBox(bool aIsLocked, Location3i aLocation) - : base("lockbox") - { - IsLocked = aIsLocked; - Location = aLocation; - } - - /// - /// Add - /// - /// - public override void Add(IItem item) - { - base.Add(item); - } - - /// - /// IsLocked - /// - public bool IsLocked { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Containers/LootContainer.cs b/src/DotNetHack/Game/Items/Containers/LootContainer.cs deleted file mode 100644 index 15760b4..0000000 --- a/src/DotNetHack/Game/Items/Containers/LootContainer.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game.Interfaces -{ - /// - /// LootContainer - /// - public abstract class LootContainer : Item - { - /// - /// LootContainer - /// - public LootContainer(string aName) - : base(aName, '[', Colour.DarkRed) - { - Items = new List(); - } - - /// - /// Add - /// - /// - public virtual void Add(IItem item) - { - Items.Add(item); - } - - /// - /// Clear - /// - protected virtual void Clear() { Items.Clear(); } - - /// - /// Remove - /// - public virtual void Remove(IItem item) { Items.Remove(item); } - - /// - /// Contains - /// - /// - /// - public bool Contains(IItem item) { return Items.Contains(item); } - - /// - /// Count - /// - public int Count { get { return Items.Count; } } - - /// - /// Items - /// - protected List Items { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Currency.cs b/src/DotNetHack/Game/Items/Currency.cs deleted file mode 100644 index f71e55c..0000000 --- a/src/DotNetHack/Game/Items/Currency.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items -{ - public static class CurrencyModifier - { - public const int GOLD = 10000; - public const int SILVER = 100; - public const int COPPER = 1; - } - /// - /// Currency - /// - [Serializable] - public class Currency : Item, IEquatable - { - /// - /// Currency - /// - /// Amount - public Currency(int aAmount, int modifier = CurrencyModifier.COPPER) - : base(ItemType.Currency, "Gold", '$', Colour.Yellow) - { - // Given that we seem to be currently setting things in amounts of gold, - // We'll have the default value set to gold. Amount gets set accordingly: - Amount = aAmount * modifier; - - /* - switch (modifier) - { - case CurrencyModifier.GOLD: - C = Colour.Yellow; - break; - case CurrencyModifier.SILVER: - C = Colour.Silver; - break; - case CurrencyModifier.COPPER: - C = Colour.Copper; - break; - }*/ - } - - /// - /// The amont of currency this represents. - /// This should be in the lowest available amount - /// - public int Amount { get; set; } - - /// - /// Gold returns how much gold the user has - /// or sets how much gold the user has. - /// - public int Gold - { - get - { - return Amount / 10000; - } - - set - { - Amount -= Amount / 10000; // Removes the old amount of gold - Amount += value * 10000; - } - } - - /// - /// Silver returns how much silver the user has - /// or sets how much silver the user has. - /// - public int Silver - { - get - { - return ((Amount % 10000) - (Amount % 100)) / 100; - } - - set - { - Amount -= ((Amount % 10000) - (Amount % 100)); - Amount += value * 100; - } - } - - /// - /// Copper sets or returns the amount of copper a - /// user has. - /// - public int Copper - { - get - { - return Amount % 100; - } - - set - { - Amount -= Amount % 100; - Amount += value; - } - } - - /// - /// operator + - /// - /// LHS - /// RHS - /// The new amount - public static Currency operator +(Currency a, Currency b) - { - return new Currency(a.Amount + b.Amount); - } - - /// - /// operator < - /// - /// - /// - /// - public static bool operator <(Currency a, Currency b) - { - return (a.Amount < b.Amount); - } - - /// - /// operator > - /// - /// - /// - /// - public static bool operator >(Currency a, Currency b) - { - return (a.Amount > b.Amount); - } - - /// - /// operator >= - /// - /// LHS - /// RHS - /// true when condition met - public static bool operator >=(Currency a, Currency b) - { - return (a.Amount >= b.Amount); - } - - /// - /// operator <= - /// - /// LHS - /// RHS - /// true when condition met - public static bool operator <=(Currency a, Currency b) - { - return (a.Amount <= b.Amount); - } - - /// - /// Equals - /// - /// The Currency to compare to - /// true when equal - public bool Equals(Currency other) - { - return this.Amount.Equals(other.Amount); - } - - /// - /// GetHashCode - /// - /// The amount is good enough for the hash - public override int GetHashCode() { return this.Amount; } - - /// - /// Returns a string representation of this Currency. - /// - /// A string representing the total currency. - public override string ToString() { return string.Format("{0}g{1}s{2}c", - Gold, Silver, Copper); } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Armor/ArmorLocation.cs b/src/DotNetHack/Game/Items/Equipment/Armor/ArmorLocation.cs deleted file mode 100644 index 11d5868..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Armor/ArmorLocation.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Armour -{ - /// - /// WornArmourLocation - /// - public enum ArmourLocation - { - Head, - Neck, - Chest, - Arms, - Hands, - LeftFinger, - RightFinger, - Legs, - Feet, - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Armor/ArmorType.cs b/src/DotNetHack/Game/Items/Equipment/Armor/ArmorType.cs deleted file mode 100644 index 8703a6f..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Armor/ArmorType.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Armour -{ - /// - /// ArmourType - /// - public enum ArmourType - { - Greave, - Gauntlet, - Cuirass, - Hauberk, - Helm, - SkullCap, - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Armor/ArmorWorn.cs b/src/DotNetHack/Game/Items/Equipment/Armor/ArmorWorn.cs deleted file mode 100644 index b430457..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Armor/ArmorWorn.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; -using DotNetHack.Game.Actions; - -namespace DotNetHack.Game.Items.Equipment.Armour -{ - /// - /// ArmourWorn - /// - [Serializable] - public class ArmourWorn - { - /// - /// Creates a new instance of worn armour. - /// - public ArmourWorn() - { - WornArmour = new Dictionary(); - } - - /// - /// Puts on a piece of armour. Can possibily be interrupted with a - /// confirmation to remove a peice if that delegate is !null. - /// - /// The peice of armour to put on - /// - public void PutOn(IArmour aArmour, bool confirm = true) - { - if (WornArmour.ContainsKey(aArmour.ArmourLocation)) - { - if (TakeOff(WornArmour[aArmour.ArmourLocation], confirm)) - WornArmour.Add(aArmour.ArmourLocation, aArmour); - } - else WornArmour.Add(aArmour.ArmourLocation, aArmour); - - // fire off events. - if (OnFinishedDressingManeuver != null) - OnFinishedDressingManeuver(this, - new EquipmentEventArgs( - DressingActionType.PutOn, aArmour)); - } - - /// - /// Take off a piece of worn armour. - /// - /// - public bool TakeOff(IArmour aArmour, bool confirm = true) - { - if (WornArmour.ContainsKey(aArmour.ArmourLocation)) - { - if (RemoveArmourConfirm != null && confirm) - { - if (RemoveArmourConfirm( - string.Format("Remove {0}?", aArmour.Name))) { } - } - else WornArmour.Remove(aArmour.ArmourLocation); - - // fire off events. - if (OnFinishedDressingManeuver != null) - OnFinishedDressingManeuver(this, - new EquipmentEventArgs( - DressingActionType.TakeOff, aArmour)); - - return true; - } - - if (OnFinishedDressingManeuver != null) - OnFinishedDressingManeuver(this, - new EquipmentEventArgs( - DressingActionType.Neither, aArmour)); - - return false; - } - - /// - /// Where, uses a predicate to return an enumeration. - /// - /// The predicate. - /// an enumeration that satisfies the predicate. - public IEnumerable Where(Func aPredicate) - { - foreach (IArmour iArmour in WornArmour.Values) - if (aPredicate(iArmour)) - yield return iArmour; - } - - /// - /// ArmourMeleeStrike - /// - /// - /// - public void ArmourMeleeStrike(Actor aAttacker, Actor aDefender) - { - foreach (var a in Where(x => x.Condition > 0)) - a.ArmourStrike(new Events.ArmourStrikeEventArgs( - aDefender, aAttacker, a)); - } - - /// - /// Returns the summation of stats from items that meet the predicate. - /// - /// The predicate - /// A object. - public StatsBase CommutedStats(Func aPredicate) - { - StatsBase stats = new StatsBase(); - foreach (IArmour iArmour in WornArmour.Values) - if (aPredicate(iArmour)) - stats += iArmour.StatsBase; - return stats; - } - - /// - /// GetWornArmourByLocation - /// - /// The specific location to get armour at. - /// The armour on equipped at this location. - public IArmour GetWornArmourByLocation(ArmourLocation aArmourLocation) - { - if (WornArmour.Keys.Contains(aArmourLocation)) - return WornArmour[aArmourLocation]; - return null; - } - - /// - /// Confirm delegate for remove armour. - /// - Input.Confirm RemoveArmourConfirm = null; - - /// - /// occurs any time a dressing manuver occurs - /// - public event EventHandler> OnFinishedDressingManeuver; - - /// - /// The type of dressing action type - /// - public enum DressingActionType { PutOn, TakeOff, Neither }; - - /// - /// The associative dictionary of worn Armour. - /// - [System.Xml.Serialization.XmlIgnore] - public Dictionary WornArmour { get; set; } - } -} - diff --git a/src/DotNetHack/Game/Items/Equipment/Armor/Armour.cs b/src/DotNetHack/Game/Items/Equipment/Armor/Armour.cs deleted file mode 100644 index 0de0cab..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Armor/Armour.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items.Equipment.Armour; -using DotNetHack.Game.Events; - - -namespace DotNetHack.Game.Items.Equipment.Armor -{ - [Serializable] - public class Armour : Item, IArmour, IDisposable - { - /// - /// Armour - /// - public Armour() : base() { } - - public Armour(string aName, char aGlyph, Colour aColour, Location3i l, - ArmourLocation aArmourLocation) - : base(ItemType.Armour, aName, aGlyph, aColour, l) - { - // set armour stats - ArmourStats = new Armor.ArmourStats() - { - Condition = 100, - Weight = 1.0, // WARNING: Add weight. - }; - - ArmourLocation = aArmourLocation; - ArmourStats.Condition = 100; - } - - /// - /// OnSpellStrike - /// - public event EventHandler OnSpellStrike; - - /// - /// OnMeleeStrike - /// - public event EventHandler OnMeleeStrike; - - /// - /// - /// - /// - public void ArmourStrike(ArmourStrikeEventArgs args) - { - if (OnMeleeStrike != null) - OnMeleeStrike(this, args); - } - - /// - /// ArmourLocation - /// - public ArmourLocation ArmourLocation { get; set; } - - /// - /// StatsBase - /// - public StatsBase StatsBase { get; set; } - - /// - /// ArmourStats - /// - public ArmourStats ArmourStats { get; set; } - - /// - /// The condition of this piece of armour. - /// - public int Condition - { - get { return ArmourStats.Condition; } - set { ArmourStats.Condition = value; } - } - - /// - /// Dispose - /// - public void Dispose() - { - OnSpellStrike = null; - OnMeleeStrike = null; - } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Armor/ArmourStats.cs b/src/DotNetHack/Game/Items/Equipment/Armor/ArmourStats.cs deleted file mode 100644 index 173a368..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Armor/ArmourStats.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Armor -{ - [Serializable] - public class ArmourStats - { - public ArmourStats() { } - - public double Weight { get; set; } - public int Condition { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Armor/ExperimentalArmour.cs b/src/DotNetHack/Game/Items/Equipment/Armor/ExperimentalArmour.cs deleted file mode 100644 index e220705..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Armor/ExperimentalArmour.cs +++ /dev/null @@ -1,219 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Effects; -using DotNetHack.Game.Items.Equipment.Armour; - -namespace DotNetHack.Game.Items.Equipment.Armor -{ - #region Cloth Set - - [Serializable] - public class ClothSetPiece : Armour - { - public ClothSetPiece(Location3i l, ArmourLocation aArmourLocation) - : base(string.Empty, '{', Colour.Standard, l, aArmourLocation) - { - switch (aArmourLocation) - { - default: Name = "Cloth " + aArmourLocation; - break; - case Equipment.Armour.ArmourLocation.Legs: - Name = "Cloth Pants"; - break; - } - ArmourStats = new Armor.ArmourStats() - { - Condition = 100, - Weight = 0.5, - }; - switch (aArmourLocation) - { - default: - StatsBase = new StatsBase() { ArmourClass = 1, }; - break; - case Equipment.Armour.ArmourLocation.Chest: - StatsBase = new StatsBase() { ArmourClass = 2, }; - break; - } - } - } - - [Serializable] - public class ClothShoes : ClothSetPiece - { - public ClothShoes(Location3i l) - : base(l, ArmourLocation.Feet) { } - } - - [Serializable] - public class ClothShirt : ClothSetPiece - { - public ClothShirt(Location3i l) - : base(l, ArmourLocation.Chest) { } - } - - [Serializable] - public class ClothPants : ClothSetPiece - { - public ClothPants(Location3i l) - : base(l, ArmourLocation.Legs) { } - } - - #endregion - - [Serializable] - public class ChestpieceOfDebugging : Armour - { - public ChestpieceOfDebugging() : base() { } - - public ChestpieceOfDebugging(Location3i l) - : base("Chestpiece of Debugging", '{', - Colour.Silver, l, Equipment.Armour.ArmourLocation.Chest) - { - ArmourStats = new Armor.ArmourStats() - { - Condition = 100, - Weight = 1, - }; - StatsBase = new StatsBase() - { - Strength = 1, - Perception = 1, - Endurance = 1, - Charisma = 1, - Intelligence = 12, - Agility = 1, - Luck = 1, - }; - } - } - -#if DEBUG - - // WARNING: EXPERIMENTAL - // WARNING: EXPERIMENTAL - // WARNING: EXPERIMENTAL - // WARNING: EXPERIMENTAL - // WARNING: EXPERIMENTAL - - [Serializable] - public class HauberkOfDefense : Armour - { - public HauberkOfDefense() { } - public HauberkOfDefense(Location3i l) - : base("Hauberk of Defense", - '{', Colour.Silver, l, - Equipment.Armour.ArmourLocation.Chest) - { - StatsBase = new StatsBase() - { - Strength = 0, - Perception = 0, - Endurance = 6, - Charisma = 0, - Intelligence = 0, - Agility = 0, - Luck = 0, - }; - } - } - - [Serializable] - public class BandOfSalvation : Armour - { - /// - /// BandOfSalvation - /// - /// - public BandOfSalvation(Location3i l) - : base("Band of Salvation", '/', Colour.Silver, - l, Equipment.Armour.ArmourLocation.LeftFinger) - { - StatsBase = new StatsBase() { Intelligence = 8 }; - ArmourStats = new Armor.ArmourStats() - { - Condition = 100, - Weight = 0.1, - }; - - // occurs on melee strike. - OnMeleeStrike += - new EventHandler( - BandOfSalvation_OnMeleeStrike); - } - - void BandOfSalvation_OnMeleeStrike(object sender, Events.ArmourStrikeEventArgs e) - { - if (Dice.D(50)) - { - if (e.WornByActor.EffectStack.FirstOrDefault( - x => x.Guid.Equals(BandOfSalvation_OnMeleeStrike_Guid)) == null) - e.WornByActor.EffectStack.Add( - new Effects.Effect() - { - Magnitude = 1, - Duration = 30, - EffectModifiers = delegate(Effect effect, Actor t) { t.Stats.Health += 1; }, - Guid = BandOfSalvation_OnMeleeStrike_Guid, - }); - } - } - - readonly Guid BandOfSalvation_OnMeleeStrike_Guid = - new Guid("52ade84e-33c2-43c1-b295-bdd525e758d6"); - } - - [Serializable] - public class GauntletsOfBane : Armour - { - public GauntletsOfBane() { } - public GauntletsOfBane(Location3i l) - : base("Gauntlets of Bane", - '{', Colour.Silver, l, - Equipment.Armour.ArmourLocation.Arms) - { - StatsBase = new StatsBase() - { - Strength = 5, - Perception = 0, - Endurance = 50, - Charisma = 0, - Intelligence = 0, - Agility = 0, - Luck = 0, - }; - } - } - - [Serializable] - public class GauntletsOfWisdom : Armour - { - public GauntletsOfWisdom() { } - public GauntletsOfWisdom(Location3i l) - : base("Gauntlets of Wisdom", - '{', Colour.Silver, l, - Equipment.Armour.ArmourLocation.Arms) - { - StatsBase = new StatsBase() - { - Strength = 0, - Perception = 0, - Endurance = 0, - Charisma = 0, - Intelligence = 5, - Agility = 0, - Luck = 0, - }; - } - } - - // WARNING: EXPERIMENTAL - // WARNING: EXPERIMENTAL - // WARNING: EXPERIMENTAL - // WARNING: EXPERIMENTAL - -#endif -} diff --git a/src/DotNetHack/Game/Items/Equipment/EquipUsage.cs b/src/DotNetHack/Game/Items/Equipment/EquipUsage.cs deleted file mode 100644 index 2b6ed82..0000000 --- a/src/DotNetHack/Game/Items/Equipment/EquipUsage.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment -{ - /// - /// - /// - /// The enumeration that makes it special - /// The exact item type - public class EquipUsage - { - - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Material.cs b/src/DotNetHack/Game/Items/Equipment/Material.cs deleted file mode 100644 index e134651..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Material.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment -{ - /// - /// Material - /// - [Flags] - public enum Material - { - Stone, - Wooden, - Steel, - Iron, - Gold, - Silver, - Leather, - Cloth, - Glass, - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Quality.cs b/src/DotNetHack/Game/Items/Equipment/Quality.cs deleted file mode 100644 index c5c7737..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Quality.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment -{ - /// - /// Quality - /// - public enum Quality - { - Shoddy, - Fine, - Remarkable, - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Tools/AlchemyEquipment.cs b/src/DotNetHack/Game/Items/Equipment/Tools/AlchemyEquipment.cs deleted file mode 100644 index 268465f..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Tools/AlchemyEquipment.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Tools -{ - public abstract class AlchemyEquipment : Tool - { - public AlchemyEquipment(string name, Glyph glyph, double potion_quality, - double effect_strength, double effect_duration, double harmful_effect_magnitude) - : base(name, glyph.G, glyph.C) - { - AlchemyEquipmentEffect = new AlchemyEquipmentEffect(potion_quality, effect_strength, - effect_duration, harmful_effect_magnitude); - } - - /// - /// The effect imbued on potions and elixers - /// - public AlchemyEquipmentEffect AlchemyEquipmentEffect { get; set; } - - /// - /// Base modifier - /// - public double BaseModifier { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Tools/AlchemyEquipmentEffect.cs b/src/DotNetHack/Game/Items/Equipment/Tools/AlchemyEquipmentEffect.cs deleted file mode 100644 index bd7b6e1..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Tools/AlchemyEquipmentEffect.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Items.Equipment.Tools; - -namespace DotNetHack.Game.Items.Equipment.Tools -{ - /// - /// An effect imbued by alchemy equipment upon the creation of potions; - /// more specifically the resulting potion. - /// - public class AlchemyEquipmentEffect - { - /// - /// Create a new AlchemyEquipmentEffect - /// - /// potion stregth for positive effects - /// duration of positive effects - /// stregth of negative effects - /// duration of negative effects - public AlchemyEquipmentEffect(double potion_quality, double effect_strength, - double effect_duration, double harmful_effect_magnitude) - { - PotionQuality = potion_quality; - PositiveStrength = effect_strength; - PositiveEffectDuration = effect_duration; - HarmfulEffectMagnitude = harmful_effect_magnitude; - } - - /// - /// The potion quality modifier - /// - public double PotionQuality { get; set; } - - /// - /// The beneficial stregth modifier - /// - public double PositiveStrength { get; set; } - - /// - /// The duration modifier of positive effects - /// - public double PositiveEffectDuration { get; set; } - - /// - /// The harmful effect modifier - /// - public double HarmfulEffectMagnitude { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Tools/Alembic .cs b/src/DotNetHack/Game/Items/Equipment/Tools/Alembic .cs deleted file mode 100644 index cf32774..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Tools/Alembic .cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Tools -{ - public class Alembic : AlchemyEquipment - { - public Alembic(double m) - : base("Alembic", new Glyph('σ', Colour.Standard), 0.0, m, 0.0, 0.0) - { } - - public override void Apply(Interfaces.IItem[] items) { } - - public override void Use() { } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Tools/Calcinator.cs b/src/DotNetHack/Game/Items/Equipment/Tools/Calcinator.cs deleted file mode 100644 index 1efd153..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Tools/Calcinator.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Tools -{ - public class Calcinator : AlchemyEquipment - { - public Calcinator(double m) - : base("Calcinator", new Glyph('π', Colour.Standard), 0.0, 0.0, 0.0, -m) - { } - - public override void Apply(Interfaces.IItem[] items) { } - - public override void Use() { } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Tools/MortarAndPestle.cs b/src/DotNetHack/Game/Items/Equipment/Tools/MortarAndPestle.cs deleted file mode 100644 index 08da0d1..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Tools/MortarAndPestle.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Items.Herbs; - -namespace DotNetHack.Game.Items.Equipment.Tools -{ - /// - /// MortarAndPestle - /// - public class MortarAndPestle : AlchemyEquipment - { - /// - /// MortarAndPestle - /// - public MortarAndPestle(double m) - : base("Mortar & Pestle", new Glyph('ü', Colour.Standard), - m, 0.0, 0.0, 0.0) - { } - - /// - /// - /// - /// - public override void Apply(Interfaces.IItem[] items) - { - - } - - /// - /// Occurs when the mortar and pestle is "used". - /// - public override void Use() - { - - } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Tools/PickAxe.cs b/src/DotNetHack/Game/Items/Equipment/Tools/PickAxe.cs deleted file mode 100644 index 97f3e86..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Tools/PickAxe.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Tools -{ - /// - /// PickAxe - /// - public class PickAxe : Tool - { - /// - /// PickAxe - /// - public PickAxe() - : base("Pick Axe", '√', Colour.Silver) - { } - - /// - /// Use - /// - public override void Use() - { - - } - - public override void Apply(Interfaces.IItem[] items) - { - - } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Tools/Tool.cs b/src/DotNetHack/Game/Items/Equipment/Tools/Tool.cs deleted file mode 100644 index 8415607..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Tools/Tool.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.UI; - -namespace DotNetHack.Game.Items.Equipment.Tools -{ - /// - /// Tool - /// - public abstract class Tool : Item, ITool - { - /// - /// Tool - /// - /// The name of this tool - /// The glyph this tool is displayed as. - /// The colour of the glyph. - public Tool(string aName, Char aGlyph, Colour aColour) - : base(aName, aGlyph, aColour) { } - - /// - /// Use - /// - public abstract void Use(); - - /// - /// Appply - /// - /// - public abstract void Apply(IItem[] items); - - /// - /// The number of uses remaining. - /// - public int UsesRemaining { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Weapons/ExperimentalWeapons.cs b/src/DotNetHack/Game/Items/Equipment/Weapons/ExperimentalWeapons.cs deleted file mode 100644 index 47bfcff..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Weapons/ExperimentalWeapons.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Weapons -{ - [Serializable] - public class RustedLongsword : Weapon - { - public RustedLongsword(Location3i l) - : base("Rusted Longsword", '(', Colour.Standard, l, - new WeaponProperties() - { - BaseWeaponDamage = 3, - Condition = 100, - MaxCondition = 100, - RustAccumulator = 50, - WeaponMaterial = Material.Steel | Material.Wooden, - }, WeaponLocation.MainHand, - WeaponSubType.LongBlade | WeaponSubType.TwoHanded) - { } - } - - [Serializable] - public class RustedShortsword : Weapon - { - public RustedShortsword(Location3i l) - : base("Rusted Shortsword", '(', Colour.Standard, l, - new WeaponProperties() - { - BaseWeaponDamage = 2, - Condition = 100, - MaxCondition = 100, - RustAccumulator = 50, - WeaponMaterial = Material.Steel | Material.Wooden, - }, WeaponLocation.MainHand, - WeaponSubType.ShortBlade | WeaponSubType.MainHand) - { } - } - - [Serializable] - public class ShortswordOfRending : Weapon - { - public ShortswordOfRending(Location3i l) - : base("Shortsword of rending", '(', Colour.Standard, l, - new WeaponProperties() - { - BaseWeaponDamage = 5, - WeaponMaterial = Material.Steel, - RustAccumulator = 0, - Condition = 100, - MaxCondition = 100, - }, WeaponLocation.MainHand, - WeaponSubType.MainHand | WeaponSubType.ShortBlade) - { } - - protected override void WeaponStrike() - { - base.WeaponStrike(); - } - } - - [Serializable] - public class ShortswordOfTheBear : Weapon - { - public ShortswordOfTheBear(Location3i l) - : base("Shortsword of the Bear", '(', Colour.Standard, l, - new WeaponProperties() - { - BaseWeaponDamage = 5, - WeaponMaterial = Material.Steel, - RustAccumulator = 0, - Condition = 100, - MaxCondition = 100, - }, WeaponLocation.MainHand, - WeaponSubType.MainHand | WeaponSubType.ShortBlade) { } - - protected override void WeaponStrike() - { - base.WeaponStrike(); - } - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Weapons/Weapon.cs b/src/DotNetHack/Game/Items/Equipment/Weapons/Weapon.cs deleted file mode 100644 index c16823e..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Weapons/Weapon.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; - -namespace DotNetHack.Game.Items.Equipment.Weapons -{ - - /// - /// Weapon - /// - [Serializable] - public abstract class Weapon : Item, IWeapon - { - public Weapon() - { - } - - /// - /// creates a new weapon - /// - /// the name of the weapon - /// the weapon glyph - /// the weapon colour - /// the weapon location. - /// weapon properties - /// worn location - /// weapon subtype - public Weapon(string aName, char aGlyph, Colour aColor, Location3i l, - WeaponProperties aWProps, WeaponLocation aLoc, WeaponSubType aSubType) - : base(ItemType.Weapon, aName, aGlyph, aColor, l) - { - WeaponProperties = aWProps; - WeaponSubType = aSubType; - WeaponLocation = aLoc; - } - - /// - /// WeaponProperties - /// - public WeaponProperties WeaponProperties { get; set; } - - /// - /// the worn weapon location - /// - public WeaponLocation WeaponLocation { get; set; } - - /// - /// the type of weapon this is - /// - public WeaponType WeaponType { get; set; } - - /// - /// the various weapon subtypes allow for further classification. - /// - public WeaponSubType WeaponSubType { get; set; } - - /// - /// WeaponStrikeEventHandler - /// - public event EventHandler OnWeaponStrike; - - /// - /// OnStrike - /// - protected virtual void WeaponStrike() - { - if (OnWeaponStrike != null) - OnWeaponStrike(this, new WeaponEventArgs(this)); - } - - /// - /// The overall health of this weapon. - /// - public int Condition - { - get { return WeaponProperties.Condition; } - set - { - // the maximum condition can not be exceeded. - if (value > WeaponProperties.MaxCondition) - WeaponProperties.Condition = WeaponProperties.MaxCondition; - else WeaponProperties.Condition = value; - } - } - - /// - /// HasSubTypeFlag - /// - /// The subtype flag to check - /// - public bool HasSubTypeFlag(WeaponSubType aWeaponSubType) - { - if ((this.WeaponSubType & aWeaponSubType) == aWeaponSubType) - return true; - return false; - } - - - /// - /// ToString - /// - /// - public override string ToString() - { - return string.Format("{0}", Name); - } - - /// - /// Loads all available weapons and returns them as an array. - /// - /// - public static Weapon[] Load() - { - return null; - } - } -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponLocation.cs b/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponLocation.cs deleted file mode 100644 index 9fe4670..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponLocation.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Weapons -{ - /// - /// locations a given weapon can be in. - /// - public enum WeaponLocation - { - /// - /// the weapon is taking up both hands. - /// - BothHands, - - /// - /// the weapon is harmless - /// - Sheathed, - - /// - /// posessed in the main hand. - /// - MainHand, - - /// - /// posessed in the offhand. - /// - OffHand, - - /// - /// on the back - /// - Back, - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponProperties.cs b/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponProperties.cs deleted file mode 100644 index 5cbea0c..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponProperties.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Utility; - -namespace DotNetHack.Game.Items.Equipment.Weapons -{ - /// - /// WeaponProperties - /// - [Serializable] - public class WeaponProperties - { - /// - /// creates a new instance of weapon properties - /// - public WeaponProperties() - { - _rustAccumulator = 0; - } - - /// - /// the base weapon damage - /// - public int BaseWeaponDamage { get; set; } - - /// - /// Condition - /// - public int Condition { get; set; } - - /// - /// The maximum condiation or health for this weapon. - /// - public int MaxCondition { get; set; } - - /// - /// Rusted - /// - public int RustAccumulator - { - get { return _rustAccumulator; } - set - { - // not all materials rust - if (WeaponMaterial.HasFlag(Material.Iron) || - WeaponMaterial.HasFlag(Material.Steel)) - _rustAccumulator = value; - } - } - - // assumulates rust - private int _rustAccumulator; - - /// - /// The material this weapon is made out of. - /// - public Material WeaponMaterial { get; set; } - - /// - /// Is this weapon below the condition threshold. - /// - public bool Broken - { - get - { - return (Util.Percent(Condition, MaxCondition) - < CONDITION_THRESHOLD); - } - } - - /// - /// percentage points - /// - const int CONDITION_THRESHOLD = 5; - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponSubType.cs b/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponSubType.cs deleted file mode 100644 index 77dd893..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponSubType.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Weapons -{ - /// - /// weapon subtype allows for furtther classification of the weapon. - /// - [Flags] - public enum WeaponSubType - { - /// - /// If this a main handed weapon? - /// - MainHand, - - /// - /// can this weapon be thrown - /// - Thrown, - - /// - /// is this a two handed weapon? (like bows) - /// - TwoHanded, - - /// - /// can this weapon be dual wielded? - /// - DualWield, - - /// - /// will this work as an offhand weapon? - /// - OffHand, - - #region additional classification - - /// - /// A blunt weapon - /// - Blunt, - - /// - /// is this a ranged weapon (requires ammo) - /// - Ranged, - - /// - /// A longer blade - /// - LongBlade, - - /// - /// A short blade - /// - ShortBlade, - - #endregion - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponType.cs b/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponType.cs deleted file mode 100644 index 27c1837..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponType.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Equipment.Weapons -{ - /// - /// WeaponType - /// - /// - public enum WeaponType - { - Claymore, - Flamberge, - Longsword, - Rapier, - Sabre, - Scimitar, - Shortsword, - BattleAxe, - Club, - Flail, - Mace, - Maul, - MorningStar, - Quarterstaff, - Pike, - Halberd, - Swordstaff, - Bow, - Longbow, - RecurveBow, - Crossbow, - RepeatingCrossbow, - Sling, - ThrowingAxe, - Arquebus, - Stiletto, - Machete, - Kris, - } -} diff --git a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponsWielded.cs b/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponsWielded.cs deleted file mode 100644 index 4427607..0000000 --- a/src/DotNetHack/Game/Items/Equipment/Weapons/WeaponsWielded.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; - -namespace DotNetHack.Game.Items.Equipment.Weapons -{ - /// - /// WeaponsWielded - /// - [Serializable] - public class WeaponsWielded - { - /// - /// supports serialization - /// - public WeaponsWielded() { } - - /// - /// Wield the following weapon. - /// - /// wield this weapon. - /// show a conf message if a weapon is already wielded. - public void Wield(IWeapon aWeapon, bool confirm = true) - { - if (CurrentWeapon != null) - UnWield(CurrentWeapon, confirm); - - CurrentWeapon = aWeapon; - - if (OnWieldWeaponEvent != null) - OnWieldWeaponEvent(this, - new EquipmentEventArgs - (WieldEventType.Wield, aWeapon)); - } - - public void UnWield(IWeapon aWeapon, bool confirm = true) - { - if (UnWieldConfirm != null && confirm) - confirm = UnWieldConfirm(string.Format( - "Are you sure you want to unwield {0}", CurrentWeapon.Name)); - - if (confirm) - { - CurrentWeapon = null; - SheathedWeapon = aWeapon; - } - - if (OnWieldWeaponEvent != null) - OnWieldWeaponEvent(this, - new EquipmentEventArgs(WieldEventType.Sheath, - aWeapon)); - } - - /// - /// occurs when the weapon wield is complete. - /// - public event EventHandler> OnWieldWeaponEvent; - - /// - /// confirmation that a weapon switch will take place. - /// obviously monsters dont do this. - /// - [System.Xml.Serialization.XmlIgnore] - public Input.Confirm UnWieldConfirm = null; - - /* - /// - /// contains all wielded weapons. - /// - public Dictionary - WieldedWeapons { get; set; } - */ - - /// - /// - /// - public IWeapon CurrentWeapon { get; set; } - - /// - /// - /// - public IWeapon SheathedWeapon { get; set; } - - /// - /// the various types of wielding (or not) - /// - public enum WieldEventType - { - /// - /// wield event - /// - Wield, - - /// - /// sheath event. - /// - Sheath, - } - } -} diff --git a/src/DotNetHack/Game/Items/Food/FoodBase.cs b/src/DotNetHack/Game/Items/Food/FoodBase.cs deleted file mode 100644 index 524f00e..0000000 --- a/src/DotNetHack/Game/Items/Food/FoodBase.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Items.Food -{ - /// - /// FoodBase - /// - public abstract class FoodBase : Item, IFood - { - /// - /// FoodBase - /// - public FoodBase(string aName, int aCalories, bool aTainted = false) - : base(aName, '%', Colour.DarkRed) - { - Calories = aCalories; - Tainted = aTainted; - } - - /// - /// The number of calories in this food. - /// - public int Calories { get; set; } - - /// - /// Is this food tainted? - /// - public bool Tainted { get; set; } - - /// - /// Eat this food. - /// - public void Eat() { } - } -} diff --git a/src/DotNetHack/Game/Items/Gems/Gem.cs b/src/DotNetHack/Game/Items/Gems/Gem.cs deleted file mode 100644 index e0aaebb..0000000 --- a/src/DotNetHack/Game/Items/Gems/Gem.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Effects; - -namespace DotNetHack.Game.Items.Gems -{ - /// - /// Gem - /// - [Serializable] - public abstract class Gem - { - /// - /// Create a new instance of the base gem class. - /// - /// The name of the gem - /// The effect imbued by the gem. - public Gem(string aName, Effect aEffect) { GemEffect = aEffect; } - - /// - /// Name - /// - public string Name { get; set; } - - /// - /// GemEffect - /// - public Effect GemEffect { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Gems/GemRuby.cs b/src/DotNetHack/Game/Items/Gems/GemRuby.cs deleted file mode 100644 index aa9af64..0000000 --- a/src/DotNetHack/Game/Items/Gems/GemRuby.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Gems -{ - /// - /// GemRuby - /// - public class GemRuby : Gem - { - public GemRuby() - : base("Ruby", null) - { - } - } -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Items/Herbs/Herb.cs b/src/DotNetHack/Game/Items/Herbs/Herb.cs deleted file mode 100644 index 38fcfb7..0000000 --- a/src/DotNetHack/Game/Items/Herbs/Herb.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.UI; - -namespace DotNetHack.Game.Items.Herbs -{ - public static class HerbExtensions - { - public static Colour GetHerbColourByType(this Herb.HerbType aHerbType) - { - switch (aHerbType) - { - default: - return Colour.Grass; - case Herb.HerbType.TigerLilly: - return new Colour(ConsoleColor.Yellow, ConsoleColor.Green); - case Herb.HerbType.WhiteSage: - return new Colour(ConsoleColor.White, ConsoleColor.Green); - case Herb.HerbType.MandrakeRoot: - case Herb.HerbType.Amanita: - case Herb.HerbType.WolfsBane: - return new Colour(ConsoleColor.Red, ConsoleColor.Green); - } - } - } - - /// - /// Herb - /// - [Serializable] - public class Herb : Item - { - /// - /// Supports serialization. - /// - public Herb() { } - - /// - /// Creates a new instance of Herb - /// The name of the herb - /// The colour of the herb - /// - private Herb(HerbType aType, Colour aColour) - : base(aType.ToString(), Symbols.YEN, aColour) { } - - /// - /// Creates a new instance of Herb - /// defaults colour to green. - /// - /// The name of the herb - public Herb(HerbType aType) - : this(aType, aType.GetHerbColourByType()) { } - - /// - /// Various types of herbs - /// - public enum HerbType - { - // Various - MotherWort, - WolfsBane, - ShadeLeaf, - WhiteSage, - MandrakeRoot, - FeverFew, - Juniper, - ElderBerry, - CatsClaw, - - // floral - Hibiscus, - TigerLilly, - StarAnise, - - // Mushrooms & Fungi - DeathCap, - Amanita, - } - } -} diff --git a/src/DotNetHack/Game/Items/Item.cs b/src/DotNetHack/Game/Items/Item.cs deleted file mode 100644 index b4d8da5..0000000 --- a/src/DotNetHack/Game/Items/Item.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.UI; -using System.Diagnostics; - -namespace DotNetHack.Game.Items -{ - /// - /// TileType - /// - public enum ItemType - { - Food, - Other, - Armour, - Weapon, - Scroll, - Tome, - Potion, - Currency, - Key, - Tool, - } - - /// - /// Item - /// - [DebuggerDisplay("{Name}"), Serializable] - public abstract class Item : IItem - { - /// - /// Creates a new instance of an Item - /// - /// The type of item this is. - /// The name of the item to create - /// The glyph used to represent the item on screen. - /// The color of the item. - /// The location of the item - public Item(ItemType aItemType, string aName, char aGlyph, - Colour aColor, Location3i aLocation) - { - ItemType = aItemType; // Set the item type of this item. - Name = aName; // Set the name of the item - G = aGlyph; // Set the glyph - C = aColor; // Set the color - Location = aLocation; // The the location - } - - public Item(ItemType aItemType, string aName, char aGlyph, Colour aColor) - : this(aItemType, aName, aGlyph, aColor, null) - { } - - /// - /// Creates a new instance of an Item - /// - /// The name of the item to create - /// The glyph used to represent the item on screen. - /// The color of the item. - /// The location of the item - public Item(string aName, char aGlyph, Colour aColor, Location3i aLocation) - : this(ItemType.Other, aName, aGlyph, aColor, aLocation) - { } - - /// - /// Item - /// - /// - /// - public Item(string aName, char aGlyph, Colour aColor) - : this(aName, aGlyph, aColor, null) - { } - - /// - /// supports serialization. - /// - public Item() { } - - /// - /// Name - /// - public string Name { get; set; } - - /// - /// G - /// - public char G { get; set; } - - /// - /// Color - /// - public Colour C { get; set; } - - /// - /// Selected - /// - public bool Selected { get; set; } - - /// - /// Location - /// - public Location3i Location { get; set; } - - /// - /// ItemType - /// - public ItemType ItemType { get; set; } - - /// - /// Draw - /// - public virtual void Draw() - { - Graphics.CursorToLocation(Location); - Graphics.Draw(this); - } - } -} diff --git a/src/DotNetHack/Game/Items/ItemCollection.cs b/src/DotNetHack/Game/Items/ItemCollection.cs deleted file mode 100644 index da46692..0000000 --- a/src/DotNetHack/Game/Items/ItemCollection.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Collections.Generic; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Items -{ - /// - /// ItemCollection - /// Is a specialized collection of items that offerrs up - /// various enumerators for just about any occasion. - /// - [Serializable] - public class ItemCollection : ICollection - { - /// - /// Items, this is the core list of items in the collection. - /// Use this if you want to get everything! - /// - public List Items { get; set; } - - /// - /// Add the item to the collection. - /// - /// The item to add to the item collection. - public void Add(IItem item) { Items.Add(item); } - - /// - /// Creates a new instance of item collection. - /// - public ItemCollection() { Items = new List(); } - - /// - /// All potions in this item collection. - /// - public IEnumerable Potions - { - get - { - return ItemFilter(x => x.ItemType == ItemType.Potion); - } - } - - /// - /// All weapons in this item collection. - /// - public IEnumerable Weapons - { - get - { - return (IEnumerable) - ItemFilter(x => x.ItemType == ItemType.Weapon); - } - } - - /// - /// All armour in this item collection. - /// - public IEnumerable Armour - { - get - { - return (IEnumerable) - ItemFilter(x => x.ItemType == ItemType.Armour); - } - } - - /// - /// All scrolls in this item collection. - /// - public IEnumerable Scrolls - { - get - { - return (IEnumerable) - ItemFilter(x => x.ItemType == ItemType.Scroll); - } - } - - /// - /// All tools in this item collection. - /// - public IEnumerable Tools - { - get - { - return (IEnumerable) - ItemFilter(x => x.ItemType == ItemType.Tool); - } - } - - /// - /// All tomes in this item collection. - /// - public IEnumerable Tomes - { - get - { - return (IEnumerable) - ItemFilter(x => x.ItemType == ItemType.Tome); - } - } - - /// - /// All keys in this item collection. - /// - public IEnumerable Keys - { - get - { - return (IEnumerable) - ItemFilter(x => x.ItemType == ItemType.Key); - } - } - - /// - /// All food in this item collection. - /// - public IEnumerable Food - { - get - { - return (IEnumerable) - ItemFilter(x => x.ItemType == ItemType.Food); - } - } - - /// - /// All Equipment in this item collection. - /// - public IEnumerable Equipment - { - get - { - return (IEnumerable) - ItemFilter(x => - x.ItemType == ItemType.Armour || - x.ItemType == ItemType.Weapon); - } - } - - /// - /// ItemFilter - /// - /// - /// An enumerable list of items, depending on the lam - public IEnumerable ItemFilter(Func aFilter) - { - foreach (var iItem in Items) - if (aFilter(iItem)) - yield return (T)iItem; - } - - /// - /// Clears all items - /// - public void Clear() { Items.Clear(); } - - /// - /// Contains, if the passed item is in the collection. - /// - /// Is this item in the collection. - /// true if the item is in the collection. - public bool Contains(IItem item) { return Items.Contains(item); } - - /// - /// - /// - /// - /// - public void CopyTo(IItem[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - /// - /// Count, the number of items in the collection. - /// - public int Count { get { return Items.Count; } } - - /// - /// Returns true if this items collection has items. - /// - public bool HasItems { get { return Count > 0; } } - - /// - /// IsReadOnly - /// - public bool IsReadOnly { get { return false; } } - - /// - /// Remove - /// - /// The item to remove from the item collection - /// true on success - public bool Remove(IItem item) { return Items.Remove(item); } - - /// - /// Pops the first from the item collection. - /// - /// null if there are no items, or the item in [0] - public IItem Pop() - { - if (!HasItems) - return default(IItem); - IItem retVal = Items[0]; - Items.RemoveAt(0); - return retVal; - } - - /// - /// Peek at the topmost item without popping it off the stack. - /// - /// null if there are no items, or the item in [0] - public IItem Peek() - { - if (!HasItems) - return default(IItem); - return Items[0]; - } - - /// - /// Pushes an item to the top of the item stack - /// - /// The item to push - public void Push(IItem item) { Items.Insert(0, item); } - - /// - /// GetEnumerator - /// - /// - public IEnumerator GetEnumerator() { return Items.GetEnumerator(); } - - /// - /// GetEnumerator - /// - /// - System.Collections.IEnumerator - System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); } - } -} \ No newline at end of file diff --git a/src/DotNetHack/Game/Items/Key.cs b/src/DotNetHack/Game/Items/Key.cs deleted file mode 100644 index 4910631..0000000 --- a/src/DotNetHack/Game/Items/Key.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Items -{ - /// - /// Key - /// - /// - [Serializable] - public class Key : Item, IKey - { - /// - /// Creates a new instance of "key" with the specified KeyGuid. - /// - /// The key guid to used creating this key. - public Key(Guid aKeyGuid) - : base(Items.ItemType.Key, "Key", '╛', Colour.Yellow) - { KeyGuid = aKeyGuid; } - - /// - /// KeyGuid, the Guid used to represent this key. - /// - public Guid KeyGuid { get; set; } - } -} diff --git a/src/DotNetHack/Game/Items/Magical/Scroll.cs b/src/DotNetHack/Game/Items/Magical/Scroll.cs deleted file mode 100644 index bee6df3..0000000 --- a/src/DotNetHack/Game/Items/Magical/Scroll.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Magical -{ - class Scroll - { - } -} diff --git a/src/DotNetHack/Game/Items/Magical/Tome.cs b/src/DotNetHack/Game/Items/Magical/Tome.cs deleted file mode 100644 index 67457d4..0000000 --- a/src/DotNetHack/Game/Items/Magical/Tome.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Magical -{ - class Tome - { - } -} diff --git a/src/DotNetHack/Game/Items/Potions/Elixer.cs b/src/DotNetHack/Game/Items/Potions/Elixer.cs deleted file mode 100644 index 342b2f9..0000000 --- a/src/DotNetHack/Game/Items/Potions/Elixer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Items.Potions -{ - /// - /// Elixer - /// - [Serializable] - public abstract class Elixer : Potion - { - /// - /// Elixer - /// - public Elixer(PotionStrength aPotionStrength) - : base(PotionType.Elixer, aPotionStrength, "", new Colour(ConsoleColor.Magenta)) - { } - } -} diff --git a/src/DotNetHack/Game/Items/Potions/Elixers/ElixerOfOgreStrength.cs b/src/DotNetHack/Game/Items/Potions/Elixers/ElixerOfOgreStrength.cs deleted file mode 100644 index bc44534..0000000 --- a/src/DotNetHack/Game/Items/Potions/Elixers/ElixerOfOgreStrength.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Effects; - -namespace DotNetHack.Game.Items.Potions.Elixers -{ - [Serializable] - public class ElixerOfOgreStrength : Elixer - { - public ElixerOfOgreStrength(PotionStrength aElixerStr) - : base(aElixerStr) { } - - public override void Quaff(Actor aTarget) - { - base.Quaff(aTarget); - - aTarget.EffectStack.Add(new Effects.Effect() - { - EffectedStats = new StatsBase() { Strength = 2, Endurance = 3 }, - EffectType = Effects.EffectType.Enchantment, - Duration = 30, - Magnitude = 3, - }); - } - } -} diff --git a/src/DotNetHack/Game/Items/Potions/Elixers/ElixerOfStrength.cs b/src/DotNetHack/Game/Items/Potions/Elixers/ElixerOfStrength.cs deleted file mode 100644 index c196c9c..0000000 --- a/src/DotNetHack/Game/Items/Potions/Elixers/ElixerOfStrength.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Potions.Elixers -{ - [Serializable] - public class ElixerOfStrength : Elixer - { - public ElixerOfStrength(PotionStrength aElixerStr) - : base(aElixerStr) { } - - public override void Quaff(Actor aTarget) - { - } - } -} diff --git a/src/DotNetHack/Game/Items/Potions/HealthPotion.cs b/src/DotNetHack/Game/Items/Potions/HealthPotion.cs deleted file mode 100644 index 4402f2c..0000000 --- a/src/DotNetHack/Game/Items/Potions/HealthPotion.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.Game.Items.Potions -{ - /// - /// HealthPotion - /// - [Serializable] - public class HealthPotion : Potion - { - /// - /// HealthPotion - /// - public HealthPotion(PotionStrength aPotionStrength) - : base(PotionType.Healing, aPotionStrength, "", Colour.White) - { } - - /// - /// Quaff - /// - public override void Quaff(Actor aActor) - { - base.Quaff(aActor); - - // experimental - // TODO: Level impacts amount of healing done. - aActor.EffectStack.Add( - new Effects.Effect(Effects.EffectType.Healing, 5, 40) - { - EffectModifiers = delegate(Effects.Effect e, Actor t) - { - aActor.Stats.Health += e.Magnitude; - }, - }); - } - } -} diff --git a/src/DotNetHack/Game/Items/Potions/Potion.cs b/src/DotNetHack/Game/Items/Potions/Potion.cs deleted file mode 100644 index 5ee17cd..0000000 --- a/src/DotNetHack/Game/Items/Potions/Potion.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; -using DotNetHack.UI; - -namespace DotNetHack.Game.Items.Potions -{ - /// - /// Potion - /// - [Serializable] - public abstract class Potion : Item, IPotion - { - /// - /// Creates a (base) instance of Potion/ - /// - /// The type of potion - /// The name of the potion. - /// The color of the potion. - public Potion(PotionType aPotionType, PotionStrength aPotionStrength, - string aName, Colour aColor) - : base(ItemType.Potion, aName, '!', aColor) - { - PotionType = aPotionType; - PotionStrength = aPotionStrength; - } - - - /// - /// The type of potion - /// - public PotionType PotionType { get; set; } - - /// - /// PotionStrength - /// - public PotionStrength PotionStrength { get; set; } - - /// - /// Quaff, this base triggers event. - /// - public virtual void Quaff(Actor aTarget) - { - Sound.DoSound(Sound.SoundEventType.QuaffPotion); - if (OnQuaff != null) - OnQuaff(this, new PotionEventArgs(aTarget, this)); - } - - /// - /// Quaff event handler - /// - public event EventHandler OnQuaff; - - /// - /// ToString - /// {Superior} {Healing} Potion - /// - /// A string representation of this potion. - public override string ToString() - { - return string.Format("{0} {1} Potion", - PotionStrength, PotionType); - } - - /// - /// StregthModifier - /// - /// StregthModifier and Effect on Magnitude - /// Elixer - /// - /// Light - /// Minor - /// Greater - /// Strong - /// Super - /// - /// - /// Poision - /// - /// Light - /// Minor - /// Greater - /// Strong - /// Super - /// - /// - /// Healing - /// - /// Light - /// Minor - /// Greater - /// Strong - /// Super - /// - /// - /// - /// - public double StregthModifier - { - get - { - switch (PotionType) - { - default: - return 1.0; - case Potions.PotionType.Elixer: - switch (PotionStrength) - { - default: - case Potions.PotionStrength.Light: - return 1; - case Potions.PotionStrength.Minor: - return 2; - case Potions.PotionStrength.Greater: - return 3; - case Potions.PotionStrength.Strong: - return 4; - case Potions.PotionStrength.Super: - return 5; - } - case Potions.PotionType.Poision: - switch (PotionStrength) - { - default: - case Potions.PotionStrength.Light: - return 2.6; - case Potions.PotionStrength.Minor: - return 3.4; - case Potions.PotionStrength.Greater: - return 4.04; - case Potions.PotionStrength.Strong: - return 4.54; - case Potions.PotionStrength.Super: - return 4.96; - } - case Potions.PotionType.Healing: - switch (PotionStrength) - { - default: - case Potions.PotionStrength.Light: - return 5; - case Potions.PotionStrength.Minor: - return 5.2; - case Potions.PotionStrength.Greater: - return 5.7; - case Potions.PotionStrength.Strong: - return 6.5; - case Potions.PotionStrength.Super: - return 7.7; - } - } - } - } - } -} diff --git a/src/DotNetHack/Game/Items/Potions/PotionStrength.cs b/src/DotNetHack/Game/Items/Potions/PotionStrength.cs deleted file mode 100644 index b4d81b3..0000000 --- a/src/DotNetHack/Game/Items/Potions/PotionStrength.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Potions -{ - /// - /// PotionStrength - /// - public enum PotionStrength { Minor, Light, Strong, Greater, Super } -} diff --git a/src/DotNetHack/Game/Items/Potions/PotionType.cs b/src/DotNetHack/Game/Items/Potions/PotionType.cs deleted file mode 100644 index 082ebe2..0000000 --- a/src/DotNetHack/Game/Items/Potions/PotionType.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Items.Potions -{ - /// - /// PotionType - /// - public enum PotionType - { - Poision, - Healing, - Elixer, - } -} diff --git a/src/DotNetHack/Game/KeyChain.cs b/src/DotNetHack/Game/KeyChain.cs deleted file mode 100644 index 554397f..0000000 --- a/src/DotNetHack/Game/KeyChain.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game -{ - /// - /// KeyChain - /// Stores all keys that the player has come across. - /// - public class KeyChain - { - /// - /// Creates a new instance of keychain. - /// - public KeyChain() - { - KeyStore = new List(); - KeyStore.Add(new Key(Guid.Empty)); - } - - /// - /// AddKey, adds a key to the key chain - /// - /// - public void AddKey(IKey aKey) { KeyStore.Add(aKey); } - - /// - /// RemoveKey, removes a key from the key chain. - /// - /// - public void RemoveKey(IKey aKey) { KeyStore.Remove(aKey); } - - /// - /// HasKey, determines if the key is contained in the key chain. - /// - /// - /// - public bool HasKey(IKey aKey) - { - return KeyStore.FirstOrDefault( - k => k.KeyGuid.Equals(aKey.KeyGuid)) != null; - } - - /// - /// HasKey, determines if the key is contained in the key chain. - /// - /// - /// - public bool HasKeyGuid(Guid aGuid) - { - return KeyStore.FirstOrDefault( - k => k.KeyGuid.Equals(aGuid)) != null; - } - - /// - /// CanUnLock, determines if this KeyChain CanUnLock whatever - /// has been passed. - /// - /// Anything that has a lock. - /// true - if the *thing* that has a lock can be unlocked. - public bool CanUnLock(IHasLock aHasLock) { return HasKeyGuid(aHasLock.KeyRef); } - - /// - /// A keychain is a collection of Guids - /// - public List KeyStore { get; set; } - } -} diff --git a/src/DotNetHack/Game/Location.cs b/src/DotNetHack/Game/Location.cs deleted file mode 100644 index 0266810..0000000 --- a/src/DotNetHack/Game/Location.cs +++ /dev/null @@ -1,391 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using DotNetHack.Game.Interfaces; -using System.Diagnostics; - - -namespace DotNetHack.Game -{ - /// - /// LocationExtensions - /// - public static class LocationExtensions - { - /// - /// Compute the distance between two objects that implement the - /// interface. - /// - /// The first has location object. - /// The second has location object. - /// - public static double Distance(this IHasLocation a, IHasLocation b) - { - return a.Location.Distance(b.Location); - } - - /// - /// Compute distance between two locations. - /// - /// - /// - /// - public static double Distance(this Location2i a, Location2i b) - { - return Math.Sqrt(Math.Pow(b.X - a.X, 2) + Math.Pow(b.Y - a.Y, 2)); - } - } - - /// - /// Location3i - /// - [Serializable] - [DebuggerDisplay("{ToString()}")] - public class Location3i : Location2i - { - /// - /// supports serialization - /// - public Location3i() - : base() - { } - - /// - /// Location3i - /// - /// A two-d location. - /// The dungeon level. - public Location3i(Location2i l, int d = 0) - : this(l.X, l.Y, d) { } - - /// - /// Location3i - /// - /// The x-coord - /// The y-coord - /// The z-coord - public Location3i(int x, int y, int d) - : base(x, y) - { D = d; } - - /// - /// D - /// - public int D { get; set; } - - /// - /// Origin3i - /// - public static readonly Location3i Origin3i = new Location3i(0, 0, 0); - - /// - ///+ - /// - /// LHS - /// RHS - /// Adds the two locations together. - public static Location3i operator +(Location3i a, Location3i b) - { - return Location3i.GetNew(a.X + b.X, a.Y + b.Y, a.D + b.D); - } - - /// - /// Returns a new 3i with passed params - /// - /// x-coord - /// y-coord - /// z-coord - /// Returns a new 3i with passed params - public static Location3i GetNew(int x, int y, int d) { return new Location3i(x, y, d); } - - /// - /// less than - /// - /// - /// - /// - public static bool operator <(Location3i a, Location3i b) - { - return a.X < b.X || a.Y < b.Y || a.D < b.D; - } - - /// - /// less than or equal to - /// - /// - /// - /// - public static bool operator <=(Location3i a, Location3i b) - { - return a.X <= b.X || a.Y <= b.Y || a.D <= b.D; - } - - /// - /// greater than or equal to - /// - /// - /// - /// - public static bool operator >=(Location3i a, Location3i b) - { - return a.X >= b.X || a.Y >= b.Y || a.D >= b.D; - } - - /// - /// g - /// - /// - /// - /// - public static bool operator >(Location3i a, Location3i b) - { - return a.X > b.X || a.Y > b.Y || a.D > b.D; - } - - /// - /// == - /// - /// - /// - /// - public static bool operator ==(Location3i a, Location3i b) - { - a = a ?? Location3i.Origin3i; - b = b ?? Location3i.Origin3i; - return a.X == b.X && a.Y == b.Y && a.D == b.D; - } - - public static bool operator !=(Location3i a, Location3i b) - { - return a.X != b.X || a.Y != b.Y || a.D != b.D; - } - - /// - /// ToString - /// - /// - public override string ToString() - { - return string.Format("({0},{1},{2})", X, Y, D); - } - } - - /// - /// Location2I - /// - [Serializable] - public class Location2i - { - /// - /// Supports serialization - /// - public Location2i() { } - - /// - /// supports serialization. - /// - /// - /// - public Location2i(int x, int y) { X = x; Y = y; } - - /// - /// Copy constructor - /// - /// The location to copy from. - public Location2i(Location2i l) { X = l.X; Y = l.Y; } - - /// - /// Y-Coordinate - /// Gets or Sets the X-Coordinate of this location. - /// - public int X { get; set; } - - /// - /// X-Coordinate - /// Gets or Sets the Y-Coordinate of this location. - /// - public int Y { get; set; } - - /// - /// Returns a new 2i with passed parameters - /// - /// x-coord - /// y-coord - /// new 2i w/ passed params - public static Location2i GetNew(int x, int y) { return new Location2i(x, y); } - - /// - /// TwoD - /// - public Location2i TwoD { get { return new Location2i(X, Y); } } - - /// - /// The Origin is the location (0,0) - /// - public static readonly Location2i Origin2i = new Location2i(0, 0); - - /// - /// + - /// - /// - /// - /// - public static Location2i operator +(Location2i a, Location2i b) - { - return new Location2i(a.X + b.X, a.Y + b.Y); - } - - /// - /// > - /// - /// - /// - /// - public static bool operator >(Location2i a, Location2i b) - { - return (a.X > b.X || a.Y > b.Y); - } - - /// - /// >= - /// - /// - /// - /// - public static bool operator >=(Location2i a, Location2i b) - { - return (a.X >= b.X || a.Y >= b.Y); - } - - /// - /// < - /// - /// - /// - /// - public static bool operator <(Location2i a, Location2i b) - { - return (a.X < b.X || a.Y < b.Y); - } - - /// - /// <= - /// - /// - /// - /// - public static bool operator <=(Location2i a, Location2i b) - { - return (a.X <= b.X || a.Y <= b.Y); - } - - /// - /// ToString - /// - /// - public override string ToString() - { - return string.Format("({0},{1})", X, Y); - } - } - -#if OBSOLETE - /// - /// Location is a location in the cartesian plane. - /// - [DebuggerDisplay("{ToString()}")] - [Serializable] - public class Location : IEquatable - { - /// - /// Location - /// - public Location() { } - - /// - /// Location - /// - /// The plane or dungeon on which this 2 dimensional location exists - /// X-Coordinate - /// Y-Coordinate - public Location(int x, int y, int d) - { - X = x; Y = y; D = d; - } - - /// - /// Y-Coordinate - /// Gets or Sets the X-Coordinate of this location. - /// - public int X { get; set; } - - /// - /// X-Coordinate - /// Gets or Sets the Y-Coordinate of this location. - /// - public int Y { get; set; } - - /// - /// Dungeon level - /// - public int D { get; set; } - - /// - /// Location - /// - /// - /// - /// - public static Location operator +(Location a, Location b) - { - return new Location(a.X + b.X, a.Y + b.Y, 0); - } - - public static bool operator >(Location a, Location b) - { - return (a.X > b.X || a.Y > b.Y); - } - - public static bool operator >=(Location a, Location b) - { - return (a.X >= b.X || a.Y >= b.Y); - } - - public static bool operator <(Location a, Location b) - { - return (a.X < b.X || a.Y < b.Y); - } - - public static bool operator <=(Location a, Location b) - { - return (a.X <= b.X || a.Y <= b.Y); - } - - /// - /// The Origin is the location (0,0) - /// - public static readonly Location Origin = new Location(0, 0); - - /// - /// Equals - /// - /// other - /// - public bool Equals(Location other) - { - return X == other.X && Y == other.Y; - } - - /// - /// ToString - /// - /// - public override string ToString() - { - return string.Format("({0},{1})", X, Y); - } - } -#endif -} diff --git a/src/DotNetHack/Game/NPC/AI/Brain.cs b/src/DotNetHack/Game/NPC/AI/Brain.cs deleted file mode 100644 index 63c2c7e..0000000 --- a/src/DotNetHack/Game/NPC/AI/Brain.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Dungeon; -using DotNetHack.Utility.Graph.Algorithm; -using DotNetHack.Game.Events; - -namespace DotNetHack.Game.NPC.AI -{ - /// - /// Extension methods for brain. - /// - public static class BrainExt - { - /// - /// SwitchDungeon allows for changing the dungeon. - /// - /// thrown when dungeon is null. - public static void SwitchDungeon(this Brain b, Dungeon.Dungeon3 aDungeon) - { - // Make sure the passed parameter is not null. - if (aDungeon == null) - throw new ArgumentNullException("Cannot switch to a null dungeon."); - - // Set the dungeon. - b.Dungeon = aDungeon; - - // Update path finding. - b.PathFinding = new DungeonPathFinding(b.Dungeon); - } - } - - /// - /// Brain - /// - [Serializable] - public class Brain - { - /// - /// The various states this brain may be in. - /// - public enum BrainState - { - Idle, - Patrol, - Attack, - Flee, - Stop, - } - - /// - /// The state machine responsible - /// - FSM FSM { get; set; } - - /// - /// CurrentState - /// - public BrainState CurrentState { get { return FSM.CurrentState; } } - - /// - /// Occures when this brain becomes aware of the player. - /// - public event EventHandler OnSeePlayer; - - /// - /// Occurs when this brain becomes aware of another monster. - /// - public event EventHandler OnSeeMonster; - - /// - /// Occurs when this brain sees an item. - /// - public event EventHandler OnSeeItem; - - /// - /// Supports serialization. - /// - public Brain() - { - FSM = new FSM( - delegate(BrainState a) - { - if (Self.Stats.HealthPercent < 10) - return BrainState.Flee; - return BrainState.Patrol; - }); - } - - /// - /// Creates a new instance of Brain. A brain requires a reference to the - /// actor and the surroundings or dungeon. - /// - /// The actor that this brain belongs to. - /// The surroundings the brain is aware of. - public Brain(Actor aSelf, Dungeon.Dungeon3 aDungeon) - : this() - { - Self = aSelf; - Dungeon = aDungeon; - PathFinding = new DungeonPathFinding(Dungeon); - } - - /// - /// The brain has "awareness" of it self. - /// - Actor Self { get; set; } - - /// - /// The brain has "awareness" of it's surroundings. - /// - public Dungeon3 Dungeon { get; set; } - - /// - /// The brains ability to find a way to things. - /// - public DungeonPathFinding PathFinding { get; set; } - } -} diff --git a/src/DotNetHack/Game/NPC/AI/FSM.cs b/src/DotNetHack/Game/NPC/AI/FSM.cs deleted file mode 100644 index 1508bae..0000000 --- a/src/DotNetHack/Game/NPC/AI/FSM.cs +++ /dev/null @@ -1,90 +0,0 @@ -/// FSM can be used for quick genericized state machines. -/// Copyright (C) 2011 Peter Jensen -/// -/// This program is free software: you can redistribute it and/or modify -/// it under the terms of the GNU General Public License as published by -/// the Free Software Foundation, either version 3 of the License, or -/// (at your option) any later version. -/// -/// This program is distributed in the hope that it will be useful, -/// but WITHOUT ANY WARRANTY; without even the implied warranty of -/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/// GNU General Public License for more details. -/// -/// You should have received a copy of the GNU General Public License -/// along with this program. If not, see . - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.NPC.AI -{ - /// - /// A genericized finite state machine. - /// The type of state this FSM may be in. - /// - [Serializable] - public class FSM - { - - /// - /// Creates a new instance of finite state machine. - /// starts out in default - /// - /// The transition table or function. - public FSM(Func aFunc) - : this(aFunc, default(S)) - { } - - /// - /// Creates a new instance of the finite state machine. - /// - /// The transition function / table used. - /// The initial state. - public FSM(Func aFunc, S aInitialState) - : this(aInitialState) { fOf = aFunc; } - - /// - /// Creates a new instance of the finite state machine. - /// The initial state of the state machine. - /// - public FSM(S aInitialState) { CurrentState = aInitialState; } - - /// - /// Creates a new instance of the finite state machine. - /// The default constructor will default the state in the - /// standard manner using default(S) - /// - public FSM() { CurrentState = default(S); } - - /// - /// The current state of the state machine. - /// readonly - /// - public S CurrentState { get; private set; } - - /// - /// Reads and yield returns the current state then moves - /// to the next state. - /// If fOf has not been set yet, expect the default state to be - /// continually returned. - /// - public IEnumerable Next - { - get - { - if (fOf == null) - yield return default(S); - yield return CurrentState; - CurrentState = fOf(CurrentState); - } - } - - /// - /// The transition function / table. - /// - Func fOf { get; set; } - } -} diff --git a/src/DotNetHack/Game/NPC/AI/IAgent.cs b/src/DotNetHack/Game/NPC/AI/IAgent.cs deleted file mode 100644 index dfe119e..0000000 --- a/src/DotNetHack/Game/NPC/AI/IAgent.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; -using DotNetHack.Game.Dungeon; - -namespace DotNetHack.Game.NPC.AI -{ - /// - /// IAgent - /// - public interface IAgent - { - /// - /// The brain for this agent - /// - Brain Brain { get; set; } - - /// - /// Step - /// - /// The dungeon - /// The player. - void Execute(Player aPlayer); - } -} diff --git a/src/DotNetHack/Game/NPC/AI/IShopKeeperAI.cs b/src/DotNetHack/Game/NPC/AI/IShopKeeperAI.cs deleted file mode 100644 index 28fbf4f..0000000 --- a/src/DotNetHack/Game/NPC/AI/IShopKeeperAI.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.NPC.AI -{ - /// - /// All shopkeepers share this common interface. - /// - public interface IShopKeeperAI : IAgent - { - /// - /// Occurs when the shopkeeper recieves payment for goods purchased. - /// - event EventHandler OnReceivePayment; - - /// - /// Greet - /// - /// - void Greet(Actor aActor); - } -} diff --git a/src/DotNetHack/Game/NPC/AI/IVillagerAI.cs b/src/DotNetHack/Game/NPC/AI/IVillagerAI.cs deleted file mode 100644 index 68a6919..0000000 --- a/src/DotNetHack/Game/NPC/AI/IVillagerAI.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.NPC.AI -{ - - public interface IVillagerAI : IAgent - { - } -} diff --git a/src/DotNetHack/Game/NPC/Agression.cs b/src/DotNetHack/Game/NPC/Agression.cs deleted file mode 100644 index 5ac976a..0000000 --- a/src/DotNetHack/Game/NPC/Agression.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.NPC -{ - /// - /// Agression - /// - public enum Agression - { - /// - /// An NPC that is passive will never attack, even in self defense. - /// - Passive, - - /// - /// An NPC that is passive agressive will never attack, except in self defense. - /// - PassiveAgressive, - - /// - /// An NPC that is agressive will attack on sight. - /// - Agressive, - - /// - /// An NPC that is hostile is actively looking for a fight. - /// - Hostile, - - /// - /// Will attack anything and everything! Including objects, humanoids, creatures - /// 10x it's size. - /// - Frenzied, - } -} diff --git a/src/DotNetHack/Game/NPC/Monsters/AI/IAI.cs b/src/DotNetHack/Game/NPC/Monsters/AI/IAI.cs deleted file mode 100644 index 0b45e2e..0000000 --- a/src/DotNetHack/Game/NPC/Monsters/AI/IAI.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Monsters.AI -{ - /// - /// AI - /// - public interface IAI - { - - } -} diff --git a/src/DotNetHack/Game/NPC/Monsters/FireAnt.cs b/src/DotNetHack/Game/NPC/Monsters/FireAnt.cs deleted file mode 100644 index 9969d96..0000000 --- a/src/DotNetHack/Game/NPC/Monsters/FireAnt.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Dungeon.Tiles; -using DotNetHack.Utility.Graph.Algorithm; - -using System.Xml.Serialization.Persisted; - -namespace DotNetHack.Game.NPC.Monsters -{ - /// - /// FireAnt - /// - [Serializable] - public class FireAnt : Monster - { - public FireAnt() - : base("fire ant", 'f', Colour.DarkRed, null) - { } - - /// - /// FireAnt - /// - /// - public FireAnt(Location3i aLocation) - : base("fire ant", 'f', Colour.DarkRed, aLocation) - { - // All fire-ants start out as passive agressive. - Agression = Game.NPC.Agression.PassiveAgressive; - - this.Write(@"c:\DNH\monsters.dat"); - } - } -} - - -#if __ -/** -// if (GameEngine.Time) // % Speed != 0 - // return; - - if (aPlayer.Distance(this) < SightDistance) - Agression = NPC.Agression.Agressive; - else Agression = NPC.Agression.PassiveAgressive; - - switch (Agression) - { - default: - { - - // TODO: this code pattern is common, should be factored out. - redo_movement: - Location3i UnitMovement = new Location3i(0, 0, Location.D); - RandomDirection.ApplyTo(UnitMovement); - Tile nMoveTo = aDungeon.GetTile(Location + UnitMovement); - if (!aDungeon.CheckBounds(Location + UnitMovement)) - goto redo_movement; - else if (nMoveTo.TileType == TileType.Wall) - goto redo_movement; - else if (nMoveTo.TileType == TileType.Water) - goto redo_movement; - - Location += UnitMovement; - break; - } - case NPC.Agression.Agressive: - { - Location3i UnitMovement = new Location3i(0, 0, Location.D); - - if (aPlayer.Location.X < Location.X) - UnitMovement.X--; - else if (aPlayer.Location.X > Location.X) - UnitMovement.X++; - else if (aPlayer.Location.Y < Location.Y) - UnitMovement.Y--; - else if (aPlayer.Location.Y > Location.Y) - UnitMovement.Y++; - - Tile nMoveTo = aDungeon.GetTile(Location + UnitMovement); - if (!aDungeon.CheckBounds(Location + UnitMovement)) - break; - else if (nMoveTo.TileType == TileType.Wall) - break; - Location += UnitMovement; - break; - } - } -*/ -#endif \ No newline at end of file diff --git a/src/DotNetHack/Game/NPC/Monsters/Monster.cs b/src/DotNetHack/Game/NPC/Monsters/Monster.cs deleted file mode 100644 index a1b6dcc..0000000 --- a/src/DotNetHack/Game/NPC/Monsters/Monster.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; - -using System.Xml.Serialization.Persisted; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game.NPC.Monsters -{ - /* -B Breath -E Engulf -G Gaze -M Magic (spell) -S Spit -W Uses weapon -X Explodes -() Defensive response when the monster is attacked -[] Defensive response when the monster is killed - */ - - /// - /// Monsters generally are NPCs that may hurt the player. - /// - [Serializable] - public class Monster : NonPlayerControlled, IMonster, IEquatable - { - /// - /// Supports serialization. - /// - public Monster() { } - - /// - /// Creates a new Monster - /// - /// The name of the monster - /// The species or glyph - /// The colour - /// The location. - public Monster(string aName, char aGlyph, Colour aColour, Location3i aLocation = null) - : base(aName, aGlyph, aColour, aLocation) - { Initialize(); } - - public bool Equals(Monster other) { return other.Location == Location; } - - /// - /// Agression level of this monster - /// - public Agression Agression { get; set; } - - /// - /// should be called after stats exist. - /// - public override void Initialize() - { - base.Initialize(); - - Stats.OnHealthChanged += new EventHandler(Stats_OnHealthChanged); - } - - public override void Execute(Player aPlayer) - { - base.Execute(aPlayer); - } - - void Stats_OnHealthChanged(object sender, EventArgs e) - { - if (Stats.Health <= 0) - { - Dead = true; - Brain.Dungeon.GetTile(this.Location) - .Items.Add(new Currency(R.Random.Next(1, 100))); - } - } - } -} diff --git a/src/DotNetHack/Game/NPC/NPC.cd b/src/DotNetHack/Game/NPC/NPC.cd deleted file mode 100644 index 817d962..0000000 --- a/src/DotNetHack/Game/NPC/NPC.cd +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - AAAABAAAAAAACAAAAAAAAAAAAAAAAAABCAAAAAAAAAA= - Game\NPC\NPC.cs - - - - - - - - - - - - - ABAABAAAAAAAAgEAAAIAAAQAAAAAAAAACAAAigAAAAA= - Game\Actor.cs - - - - - - - AAEAgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAgA= - Game\NPC\ShopKeeper.cs - - - - - - - AAAAAAAAAAAAAAAAgAAAQAAAAAAAAAAAAAAAAAAAAAA= - Game\NPC\Monsters\Monster.cs - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\NPC\Monsters\FireAnt.cs - - - - - - - - - - - Game\NPC\AI\Brain.cs - - - - - AAAAAAAgAAAAgAAAAEABAAAAAAAAAAAAAACAQAAAAgA= - Game\NPC\AI\Brain.cs - - - - - - - - - AgAgAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAA= - Game\NPC\AI\FSM.cs - - - - - - AAAAAAAgAAAAAAQAAAAAAAAAAAAAAAAAAACAAAAAAAA= - Game\NPC\AI\IAgent.cs - - - - - - AAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgA= - Game\NPC\AI\IShopKeeperAI.cs - - - - - - AAAAAAAAAAAAAAAAAAAgAAAAAAAAIAAAAAAAAAAAQAA= - Disposition.cs - - - - \ No newline at end of file diff --git a/src/DotNetHack/Game/NPC/NPC.cs b/src/DotNetHack/Game/NPC/NPC.cs deleted file mode 100644 index ce1e389..0000000 --- a/src/DotNetHack/Game/NPC/NPC.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.NPC.AI; -using System.Xml.Serialization; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Actions; - - -namespace DotNetHack.Game.NPC -{ - /// - /// non player controlled character. - /// - [Serializable] - public abstract class NonPlayerControlled : Actor, IAgent - { - /// - /// Supports serialization. - /// - public NonPlayerControlled() { } - - /// - /// Creates a new NPC with the provided parameters. - /// - /// The name of this NPC - /// - /// - public NonPlayerControlled(string aName, char aGlyph, Colour aColour, Location3i l) - : base(aName, aGlyph, aColour, l) { } - - /// - /// The level of this NPC. - /// - [XmlIgnore] - public int Level { get { return Stats.Level; } } - - /// - /// The brain for this NPC - /// - [XmlIgnore] - public Brain Brain { get; set; } - - /// - /// The current waypoint for this NPC - /// may be null - /// - IHasLocation WayPoint { get; set; } - - /// - /// TODO: EXPERIEMTNAL. - /// Everything will be wired up to events and state machines. - /// - /// - public virtual void Execute(Player aPlayer) - { - bool meleeRange = false; - - WayPoint = aPlayer; - - if (WayPoint == null) - return; - - // TODO: factor this out. - var nStack = Brain.PathFinding.Solve(this, WayPoint); - - // TODO: factor this out. - if (nStack == null) - return; - - // when the player is in range, don't pop, flag as melee range. - WayPoint = nStack.Pop(); - - // dont allow this baddy to go *onto* the player. - if (WayPoint.Location == GameEngine.Player.Location) - { - // stay right here. - WayPoint.Location = Location; - meleeRange = true; - } - - Location = WayPoint.Location; - _speedCounter = 0; - - if (meleeRange) - new ActionMeleeAttack(this, aPlayer).Perform(); - - _speedCounter++; - } - - private int _speedCounter = 0; - - /// - /// No different than initialize. - /// - /// The dungeon the NPC gets spawned into - public void Spawn(Dungeon.Dungeon3 aDungeon) - { - Brain = new AI.Brain(this, aDungeon); - } - } -} diff --git a/src/DotNetHack/Game/NPC/ShopKeeper.cs b/src/DotNetHack/Game/NPC/ShopKeeper.cs deleted file mode 100644 index 88869e7..0000000 --- a/src/DotNetHack/Game/NPC/ShopKeeper.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.NPC.AI; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; - -namespace DotNetHack.Game.NPC -{ - /// - /// ShopKeeper - /// - [Serializable] - public abstract class ShopKeeper : NonPlayerControlled, IShopKeeperAI - { - /// - /// supports serialization. - /// - public ShopKeeper() { } - - /// - /// Creates a new shopkeeper. - /// - /// - public ShopKeeper(string aShopKeeperName, Location3i l) - : base(aShopKeeperName, '@', Colour.White, l) - { - Brain = new Brain(); - } - - public void Greet(Actor aActor) - { - UI.Graphics.Display.ShowMessage( - "Hello {0}, welcome to {1}'s general store!", aActor.Name, this.Name); - } - - public event EventHandler OnReceivePayment; - - /* - event EventHandler IShopKeeperAI.OnReceivePayment - { - add { throw new NotImplementedException(); } - remove { throw new NotImplementedException(); } - }*/ - - - public override void Execute(Player aPlayer) - { - if (Dice.D(1)) - Location.X++; - else if (Dice.D(1)) - Location.X--; - else if (Dice.D(1)) - Location.Y++; - else if (Dice.D(1)) - Location.Y--; - - if (this.Distance(aPlayer) < 5) - { - if (Dice.D(20)) - { - if (aPlayer.Stats.HealthPercent < 50) - GameEngine.DoSound(new Sound(this, - 10, "Perhaps I can interest you in a healing potion?")); - else - Greet(aPlayer); - } - } - } - } - - /// - /// TheShopKeeper - /// - [Serializable] - public class GulDarTheShopKeeper : ShopKeeper - { - /// - /// Creates a new instance of the shop keeper. - /// - public GulDarTheShopKeeper(Location3i aLoc) - : base("Gul'dar", aLoc) - { - // Brain = new Brain( - } - - /// - /// should be called after stats exist. - /// - public override void Initialize() - { - base.Initialize(); - } - } -} diff --git a/src/DotNetHack/Game/NPC/Villager.cs b/src/DotNetHack/Game/NPC/Villager.cs deleted file mode 100644 index 5db931c..0000000 --- a/src/DotNetHack/Game/NPC/Villager.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.NPC.AI; - -namespace DotNetHack.Game.NPC -{ - /// - /// A villager - /// - public abstract class Villager : NonPlayerControlled, IVillagerAI - { - /// - /// Create a new villager - /// - /// The name of the villager. - /// The location of the villager. - public Villager(string aName, Location3i l) - : base(aName, '@', Colour.DarkYellow, l) - { } - - /// - /// Execute - /// - /// - public override void Execute(Player aPlayer) - { - - } - } -} diff --git a/src/DotNetHack/Game/Player.cs b/src/DotNetHack/Game/Player.cs deleted file mode 100644 index e6df5c2..0000000 --- a/src/DotNetHack/Game/Player.cs +++ /dev/null @@ -1,231 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; -using DotNetHack.Game.Dungeon; -using DotNetHack.Game.Items; -using DotNetHack.Game.Items.Equipment.Armour; -using DotNetHack.Game.Items.Equipment.Weapons; -using DotNetHack.Utility.Media; - -namespace DotNetHack.Game -{ - /// - /// Player - /// - public class Player : Actor, IDrawable - { - /// - /// Player - /// - /// - public Player(string aPlayerName) - : this(aPlayerName, new Location3i(0, 0, 0)) { } - - /// - /// GameEngine_OnSound - /// - /// - /// - void GameEngine_OnSound(object sender, SoundEventArgs e) - { - if (e.Sound.IsSoundAmbient) - UI.Graphics.Display.ShowSound(e.Sound); - else if (Stats.Perception >= e.Distance(this)) - UI.Graphics.Display.ShowSound(e.Sound); - SoundController.Instance.PlaySound(e.Description); - } - - /// - /// Player - /// - /// - /// - public Player(string aPlayerName, Location3i aLocation) - : base() - { - GameEngine.OnSound += new EventHandler(GameEngine_OnSound); - - // Create the players key-chain - KeyChain = new KeyChain(); - - // Create the players wallet. - Wallet = new Currency(0); - - G = '@'; - Name = aPlayerName; - Location = aLocation; - C = new Colour() { FG = ConsoleColor.Gray }; - Stats = new Stats() - { - Agility = 2, - Charisma = 4, - Endurance = 7, - Intelligence = 7, - Luck = 4, - Perception = 2, - Strength = 7, - }; - - Initialize(); - } - - /// - /// should be called after stats exist. - /// - public override void Initialize() - { - base.Initialize(); - - #region worn armour - - WornArmour.OnFinishedDressingManeuver += new EventHandler>(WornArmour_OnFinishedDressingManeuver); - #endregion - - #region worn weapons - WieldedWeapons.OnWieldWeaponEvent += new EventHandler>(WieldedWeapons_OnWieldWeaponEvent); - #endregion - - Stats.OnHealthChanged += new EventHandler(Stats_OnHealthChanged); - } - - /// - /// Eat - /// - public void Eat(IFood aFood) - { - aFood.Eat(); - } - - /// - /// fires when the wield status of a weapon changes. - /// - /// the sender - /// the event args (equipment) - void WieldedWeapons_OnWieldWeaponEvent(object sender, EquipmentEventArgs e) - { - switch (e.EquipEventType) - { - case WeaponsWielded.WieldEventType.Sheath: - Inventory.Push(e.EquipmentInvolved); - UI.Graphics.Display.ShowMessage("The weapon {0} has been sheathed.", - e.EquipmentInvolved.Name); - break; - case WeaponsWielded.WieldEventType.Wield: - Inventory.Remove(e.EquipmentInvolved); - UI.Graphics.Display.ShowMessage(string.Format("You are now wielding {0}.", - e.EquipmentInvolved.Name)); - - if (e.EquipmentInvolved.WeaponSubType.HasFlag(WeaponSubType.ShortBlade)) - Sound.DoSound(Sound.SoundEventType.WieldShortSowrd); - else if (e.EquipmentInvolved.WeaponSubType.HasFlag(WeaponSubType.LongBlade)) - Sound.DoSound(Sound.SoundEventType.WieldLongSword); - else if (e.EquipmentInvolved.WeaponSubType.HasFlag(WeaponSubType.Blunt)) - Sound.DoSound(Sound.SoundEventType.WieldBluntWeapon); - - /* - switch (e.EquipmentInvolved.WeaponType) - { - case WeaponType.Rapier: - case WeaponType.Stiletto: - case WeaponType.Shortsword: - case WeaponType.Scimitar: - case WeaponType.Sabre: - case WeaponType.Machete: - case WeaponType.Kris: - Sound.DoSound(Sound.SoundEventType.WieldShortSowrd); - break; - - case WeaponType.BattleAxe: - case WeaponType.Claymore: - case WeaponType.Flamberge: - case WeaponType.Longsword: - case WeaponType.Pike: - case WeaponType.Swordstaff: - case WeaponType.Halberd: - Sound.DoSound(Sound.SoundEventType.WieldLongSword); - break; - - case WeaponType.Club: - case WeaponType.Flail: - case WeaponType.Mace: - case WeaponType.Maul: - case WeaponType.MorningStar: - Sound.DoSound(Sound.SoundEventType.WieldBluntWeapon); - break; - }*/ - break; - } - } - - /// - /// occurs when a dressing meneuver is completed. - /// - /// the sender - /// the event arguemtn (equipment) - void WornArmour_OnFinishedDressingManeuver(object sender, EquipmentEventArgs e) - { - switch (e.EquipEventType) - { - case ArmourWorn.DressingActionType.PutOn: - Inventory.Remove(e.EquipmentInvolved); - UI.Graphics.Display.ShowMessage( - "You are now wearing {0}.", - e.EquipmentInvolved.Name); - break; - case ArmourWorn.DressingActionType.TakeOff: - Inventory.Push(e.EquipmentInvolved); - UI.Graphics.Display.ShowMessage( - "You are no longer wearing {0}.", - e.EquipmentInvolved.Name); - break; - } - } - - /// - /// CommutedStats - /// - public StatsBase CommutedStats() - { - // commute worn armour stats - StatsBase statsBase = WornArmour.CommutedStats(a => a.Condition > 0); - - // commute effect stats - foreach (var effect in EffectStack) - if (effect.EffectedStats != null) - statsBase = statsBase + effect.EffectedStats; - - return statsBase; - } - - /// - /// Occurs when the players health changes, this could be bad. - /// - /// the event sender - /// event args (none really since stats will be inspected) - void Stats_OnHealthChanged(object sender, EventArgs e) - { - // WARNING: hack for now, until actually die logic can be made. - if (Stats.Health <= 0) - throw new DNHackException("you died!"); - } - - /// - /// DLV - /// - public int DungeonLevel { get { return Location.D; } } - - /// - /// The players key-chain - /// - public KeyChain KeyChain { get; set; } - - /// - /// Wallet - /// - public Currency Wallet { get; set; } - } -} diff --git a/src/DotNetHack/Game/Quests/Quest.cs b/src/DotNetHack/Game/Quests/Quest.cs deleted file mode 100644 index f65257e..0000000 --- a/src/DotNetHack/Game/Quests/Quest.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Events; -using DotNetHack.Game.Items; - -namespace DotNetHack.Game.Quests -{ - /// - /// a quest is generally a list of tasks that must be done to gain - /// some in-game reward. - /// - [Serializable] - public class Quest : List - { - /// - /// fired when the quest is completed - /// - public event EventHandler OnQuestCompleted; - - /// - /// fired when the quest is first started - /// - public event EventHandler OnQuestStarted; - - /// - /// supports serialization - /// - public Quest() { } - - /// - /// Create a new quest - /// - /// The name of the quest - /// The quest description - /// The experience given - /// The monetary reward - public Quest(string name, string description, int experience, - Currency reward) - { - QuestID = Guid.NewGuid(); - Name = name; - Description = description; - Experience = experience; - Reward = reward; - Done = false; - } - - /// - /// Add a task to this quest - /// - /// the task to add to this quest - public void AddTask(Task task) { Add(task); } - - /// - /// determines if this quest has been completed by firing - /// off all predicates against the player object. - /// - /// - public bool IsComplete - { - get - { - foreach (Task t in this) - if (!t.Completed(GameEngine.Player)) - return false; - return true; - } - } - - /// - /// TryCompleteQuest - /// - public static void TryCompleteQuest(Quest q) - { - if (q.IsComplete && !q.Done) - { - if (q.OnQuestCompleted != null) - q.OnQuestCompleted(q, new QuestEventArgs(q)); - q.Done = true; - GameEngine.Player.Stats.Experience += q.Experience; - } - } - - /// - /// the amount of experience points rewarded for this quest. - /// this is the is one of two rewards that is common to all quests - /// - public int Experience { get; set; } - - /// - /// the amount of currency rewarded for the completion of this quest. - /// this is the is one of two rewards that is common to all quests - /// - public Currency Reward { get; set; } - - /// - /// the name of this quest. - /// - public string Name { get; set; } - - /// - /// the description of this quest. - /// - public string Description { get; set; } - - /// - /// If this quest is done; as in COMPLETED - /// - public bool Done { get; set; } - - /// - /// A unique identifier - /// - private readonly Guid QuestID; - - [Serializable] - /// - /// QuestEventArgs - /// - public class QuestEventArgs : EventArgs - { - /// - /// Create a new instance of quest event arguments - /// - /// the quest involed in this argument - public QuestEventArgs(Quest aQuest) { Quest = aQuest; } - - /// - /// the quest involved in this quest event - /// - public Quest Quest { get; set; } - } - - /// - /// ToString - /// - /// - /// - public override string ToString() - { - string to_s = string.Format("{0} - {1}", Name, Description); - foreach (Task t in this) - if (!t.Completed(GameEngine.Player)) - to_s += "\n » " + t.Name + " - " + t.Description; - else - to_s += "\n √ " + t.Name + " - " + t.Description; - - return to_s + "\n"; - } - } -} diff --git a/src/DotNetHack/Game/Quests/Task.cs b/src/DotNetHack/Game/Quests/Task.cs deleted file mode 100644 index b9809a7..0000000 --- a/src/DotNetHack/Game/Quests/Task.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.Game.Quests -{ - - /// - /// A task is an automic item that belongs to quests. For a quest to - /// be completed; the predicate for all contained tasks must all - /// be completed - /// - [Serializable] - public class Task - { - /// - /// supports serialization - /// - public Task() { } - - /// - /// creates a new task with passed, name, description and - /// completion predicate. the completion predicate takes a player - /// and returns a boolean value. - /// - /// the name of the new task - /// the short description for the task - /// complteion predicate. - public Task(string name, string description, - Func completed) - { - // set the name - Name = name; - - // set completion predicate - Completed = completed; - - // set description - Description = description; - } - - /// - /// the name of this task - /// - public string Name { get; set; } - - /// - /// the description of this task. - /// - public string Description { get; set; } - - /// - /// the completion predicate for this task. - /// - public Func Completed { get; set; } - } -} diff --git a/src/DotNetHack/Game/Sound.cs b/src/DotNetHack/Game/Sound.cs deleted file mode 100644 index c340b6c..0000000 --- a/src/DotNetHack/Game/Sound.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Utility.Media; - -namespace DotNetHack.Game -{ - /// - /// Sound - /// - /// 1dB - Not noticable - /// 3dB - Barely noticeable - /// 5dB - Clearly noticeable change - /// 10dB - About twice as loud - /// 20dB - About four times as loud - /// - /// Aircraft at take-off (180) - /// Fireworks (140) - /// Snowmobile (120) - /// Chain saw (110) - /// Amplified music (110) - /// Lawn mower (90) - /// Noisy office (90) - /// Vacuum cleaner (80) - /// City traffic (80) - /// Normal conversation (60) - /// Refrigerator humming (40) - /// Whisper (20) - /// Leaves rustling (10) - /// Calm breathing (10) - /// - /// A clap of thunder from a nearby storm (120 dB) or a - /// gunshot (140-190 dB, depending on weapon), can both cause immediate damage. - /// - public class Sound : IHasLocation - { - /// - /// DoSound - /// - public static void DoSound(SoundEventType aSoundEventType) - { - string strSound = ""; - switch (aSoundEventType) - { - case SoundEventType.AlchemyPotionCreate: - strSound = "alchemy_create_001"; break; - case SoundEventType.QuaffPotion: - strSound = "quaff_potion_001"; break; - case SoundEventType.DropMetalArmour: - strSound = "armour_drop_001"; break; - case SoundEventType.EquipMetalArmour: - strSound = "armour_drop_001"; break; - case SoundEventType.FootStepHumanoid: - strSound = ""; break; - case SoundEventType.SheathBluntWeapon: - strSound = "shield_drop_001"; break; - case SoundEventType.WieldBluntWeapon: - strSound = "pickup_mace_001"; break; - case SoundEventType.TrapTriggered: - strSound = "trap_trigger_001"; break; - case SoundEventType.WieldLongSword: - strSound = "wield_longsword_001"; break; - case SoundEventType.DropBladedWeapon: - strSound = "weapon_drop_001"; break; - case SoundEventType.DropBluntWeapon: - strSound = "drop_blunt_weapon_001"; break; - case SoundEventType.WieldShortSowrd: - strSound = "blacksmith_001"; break; - case SoundEventType.PickupKey: - strSound = "pickup_key_001"; break; - case SoundEventType.OpenLockedDoor: - strSound = "open_door_locked_001"; break; - case SoundEventType.LowHealthIndicator: - strSound = "heart_beating_001"; break; - } - - strSound += ".wav"; - - if (!string.Empty.Equals(strSound)) - SoundController.Instance.PlaySound(strSound); - } - - /// - /// - /// Naming Convention: - /// "verb-class" - most descriptive attribute - /// "subclass" - secondary attribute - /// - /// - public enum SoundEventType - { - PickupKey, - OpenLockedDoor, - QuaffPotion, - AlchemyPotionCreate, - FootStepHumanoid, - WieldLongSword, - WieldShortSowrd, - WieldBluntWeapon, - SheathBluntWeapon, - DropBluntWeapon, - DropMetalArmour, - DropBladedWeapon, - EquipMetalArmour, - TrapTriggered, - LowHealthIndicator, - } - - /// - /// A sound - /// - /// The source of the sound - /// The magnitude of the sound. - public Sound(IHasLocation aSource, int aDecibels, string aDescription, - bool aAmbient = false) - { - Location = aSource.Location; - SoundDecibels = aDecibels; - SoundDescription = aDescription; - IsSoundAmbient = aAmbient; - } - - /// - /// An ambient sound - /// - /// db - /// description - public Sound(int aDecibels, string aDescription) - { - IsSoundAmbient = true; - SoundDecibels = aDecibels; - SoundDescription = aDescription; - Location = Location3i.Origin3i; - } - - /// - /// if the sound is ambient. - /// - public bool IsSoundAmbient { get; set; } - - /// - /// the magnitude or loudness of the sound. - /// - public int SoundDecibels { get; set; } - - /// - /// the sound description - /// - public string SoundDescription { get; set; } - - /// - /// the source of the sound - /// - public Location3i Location { get; set; } - - /// - /// DistanceTo - /// - /// - /// - public double DistanceTo(IHasLocation l) - { - if (l == null) - return 0D; - else if (l.Location == null) - return 0D; - return Location.Distance(l.Location); - } - } -} diff --git a/src/DotNetHack/Game/Speech.cs b/src/DotNetHack/Game/Speech.cs deleted file mode 100644 index a4fb7ad..0000000 --- a/src/DotNetHack/Game/Speech.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace DotNetHack.Game -{ - /// - /// Speech - /// - public static class Speech - { - /// - /// Pluralize - /// - /// The singular form of a word - /// The number of "things" in question. - /// The plural form of the word. - public static string Pluralize(this string s, int count) - { - return Pluralizer.Pluralize(count, s); - } - - /// - /// - /// - public static class Pluralizer - { - /// - /// Unpluralizables - /// - private static readonly ISet Unpluralizables = new HashSet - { "equipment", "information", "rice", "money", "species", "series", - "fish", "sheep", "deer" }; - - /// - /// Pluralizations RegEx Dictionary - /// - private static readonly IDictionary Pluralizations = new Dictionary() - { - // Start with the rarest cases, and move to the most common - { "person", "people" }, - { "ox", "oxen" }, - { "child", "children" }, - { "foot", "feet" }, - { "tooth", "teeth" }, - { "goose", "geese" }, - // And now the more standard rules. - { "(.*)fe?", "$1ves" }, // ie, wolf, wife - { "(.*)man$", "$1men" }, - { "(.+[aeiou]y)$", "$1s" }, - { "(.+[^aeiou])y$", "$1ies" }, - { "(.+z)$", "$1zes" }, - { "([m|l])ouse$", "$1ice" }, - { "(.+)(e|i)x$", @"$1ices"}, // ie, Matrix, Index - { "(octop|vir)us$", "$1i"}, - { "(.+(s|x|sh|ch))$", @"$1es"}, - { "(.+)", @"$1s" } - }; - - /// - /// Pluralize - /// - /// The number - /// The singlular form of the word. - /// A string containing the plural form of the word. - public static string Pluralize(int count, string singular) - { - if (count == 1) - return singular; - - if (Unpluralizables.Contains(singular)) - return singular; - - var plural = ""; - - foreach (var pluralization in Pluralizations) - if (Regex.IsMatch(singular, pluralization.Key)) - { - plural = Regex.Replace(singular, - pluralization.Key, pluralization.Value); - break; - } - - return plural; - } - } - } -} diff --git a/src/DotNetHack/Game/Stats.cs b/src/DotNetHack/Game/Stats.cs deleted file mode 100644 index befa76a..0000000 --- a/src/DotNetHack/Game/Stats.cs +++ /dev/null @@ -1,275 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml.Serialization; - -namespace DotNetHack.Game -{ - /// - /// StatsBase is a simple stats abstraction. - /// items, players, npcs, enchantments may use this at will. - /// - [Serializable] - public class StatsBase - { - /// - /// create a new instance of stats base. - /// - public StatsBase() { } - - /// - /// Creates a new instance of stats base with all stats set to the same value. - /// - /// The value that all stats will be set to. - public StatsBase(int v) - { - Strength = v; - Perception = v; - Endurance = v; - Charisma = v; - Intelligence = v; - Agility = v; - Level = v; - Luck = v; - ArmourClass = v; - Wisdom = v; - } - - /// - /// the level - /// - [XmlAttribute] - public int Level { get; set; } - - /// - /// speed - /// - [XmlAttribute] - public int Speed { get; set; } - - /// - /// AC or armour class - /// - [XmlAttribute] - public int ArmourClass { get; set; } - - /// - /// strength - /// - [XmlAttribute] - public int Strength { get; set; } - - /// - /// endurance - /// - [XmlAttribute] - public int Endurance { get; set; } - - /// - /// agility - /// - [XmlAttribute] - public int Agility { get; set; } - - /// - /// wisdom. - /// - [XmlAttribute] - public int Wisdom { get; set; } - - /// - /// intelligence. - /// - [XmlAttribute] - public int Intelligence { get; set; } - - /// - /// charisma - /// - [XmlAttribute] - public int Charisma { get; set; } - - /// - /// experience. - /// - [XmlAttribute] - public int Experience { get; set; } - - /// - /// luck - /// - [XmlAttribute] - public int Luck { get; set; } - - /// - /// perception. - /// - [XmlAttribute] - public int Perception { get; set; } - - /// - /// plus operator for . - /// - /// LHS - /// RHS - /// The result of adding the two StatsBase - /// objects. - public static StatsBase operator +(StatsBase a, StatsBase b) - { - return new StatsBase() - { - Strength = a.Strength + b.Strength, - Perception = a.Perception + b.Perception, - Endurance = a.Endurance + b.Endurance, - Charisma = a.Charisma + b.Charisma, - Intelligence = a.Intelligence + b.Intelligence, - Agility = a.Agility + b.Agility, - Luck = a.Luck + b.Luck, - ArmourClass = a.ArmourClass + b.ArmourClass, - Experience = a.Experience + b.Experience, - Level = a.Level + b.Level, - Speed = a.Speed + b.Speed, - Wisdom = a.Wisdom + b.Wisdom, - }; - } - - /// - /// minus operator for . - /// See: unary - - /// - /// LHS - /// RHS - /// The result of subtracting the two StatsBase - /// objects. - public static StatsBase operator -(StatsBase a, StatsBase b) - { - return a + (-b); - } - - /// - /// unary (negate) for a object. - /// leveraged to perform subtraction. - /// - /// The StatsBase object to negate. - /// A statsbase object with each of the stats negated. - public static StatsBase operator -(StatsBase a) - { - return new StatsBase() - { - Agility = -a.Agility, - ArmourClass = -a.ArmourClass, - Charisma = -a.Charisma, - Endurance = -a.Endurance, - Experience = -a.Experience, - Intelligence = -a.Intelligence, - Level = -a.Level, - Luck = -a.Luck, - Perception = -a.Perception, - Speed = -a.Speed, - Strength = -a.Strength, - Wisdom = -a.Wisdom, - }; - } - } - - /// - /// - /// - [Serializable] - public class Stats : StatsBase - { - /// - /// - /// - public Stats() - : base() - { } - - /// - /// Health is a derrived stat. - /// - [XmlIgnore] - public int Health - { - get { return _health; } - set - { - // health is being set, and what the value is now isn't what it used to - // be. - if (_health != value) - { - _health = value; - - // trigger health changed event. - if (OnHealthChanged != null) - OnHealthChanged(this, null); - } - - // health ceiling - if (_health >= HitPoints) - _health = HitPoints; - } - } - - [XmlIgnore] - public int Mana - { - get { return _mana; } - set - { - if (_mana != value) - _mana = value; - - // mana ceiling. - if (_mana >= ManaPoints) - _mana = ManaPoints; - } - } - - /// - /// Derrived attribute - /// - public int HitPoints { get { return (int)(Strength + Endurance * 2); } } - - /// - /// Health as a percentage. - /// - [XmlIgnore] - public double HealthPercent - { - get { return (Health * 1.0 / HitPoints) * 100.0; } - } - - /// - /// Mana remaining as a percentage - /// - [XmlIgnore] - public double ManaPercent - { - get { return (Mana * 1.0 / ManaPoints) * 100.0; } - } - - /// - /// Derrived attribute - /// - [XmlIgnore] - public int ManaPoints { get { return (int)(2.5 * Intelligence); } } - - /// - /// Triggered on any change in health. - /// Note: Should be elsewhere. - /// - public event EventHandler OnHealthChanged; - - /// - /// Health backing store. - /// - private int _health; - - /// - /// Mana backing store - /// - private int _mana; - } -} diff --git a/src/DotNetHack/Game/TargetSelector.cs b/src/DotNetHack/Game/TargetSelector.cs deleted file mode 100644 index a135be3..0000000 --- a/src/DotNetHack/Game/TargetSelector.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.NPC; - -namespace DotNetHack.Game -{ - /// - /// TargetSelector - /// Used to select targets. - /// - public class TargetSelector - { - /// - /// Creates a new instance of TargetSelector - /// - /// - public TargetSelector(IEnumerable aTargets) - { - SelectTargets = aTargets.ToArray(); - } - - /// - /// Gets the next target in the target selection schedule. - /// - /// - public NonPlayerControlled NextTarget() - { - if (index >= SelectTargets.Length) index = 0; - SelectedTarget = SelectTargets[index++]; - return SelectedTarget; - } - - /// - /// If this target selector has targets. - /// - public bool HasTargets { get { return SelectTargets.Length > 0; } } - - /// - /// SelectTargets - /// - NonPlayerControlled[] SelectTargets; - - /// - /// The current SelectedTarget. - /// - NonPlayerControlled SelectedTarget { get; set; } - - /// - /// The index of the selected target. - /// - int index = 0; - } -} diff --git a/src/DotNetHack/Game/World.cs b/src/DotNetHack/Game/World.cs deleted file mode 100644 index a62f9de..0000000 --- a/src/DotNetHack/Game/World.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Items; -using System.Runtime.Serialization.Formatters.Binary; -using System.IO; - -namespace DotNetHack.Game -{ - /* - public static class WorldExtensions - { - /// - /// Load - /// - /// aWorldFile - /// - public static World Load(string aWorldFile) - { - BinaryFormatter binFormatter = new BinaryFormatter(); - using (FileStream tmpRawStream = File.Open(aWorldFile, FileMode.Open)) - return (World)binFormatter.Deserialize(tmpRawStream); - } - - /// - /// SaveAs - /// - public static bool SaveAs(this World aWorld, string aWorldFile) - { - try - { - // Create a new binary formatter - BinaryFormatter binFormatter = new BinaryFormatter(); - - using (FileStream tmpRawStream = File.Open(aWorldFile, FileMode.OpenOrCreate)) - binFormatter.Serialize(tmpRawStream, aWorld); - - return true; - } - catch { return false; } - } - } - - /// - /// World - /// - [Serializable] - public class World : Dungeon - { - /// - /// World - /// - World() { } - - // public DistantLocation - - /// - /// - /// - /// - public static World GetInstance() - { - if (_instance == null) - _instance = new World(); - - return _instance; - } - - public static World _instance; - }*/ -} diff --git a/src/DotNetHack/Input.cs b/src/DotNetHack/Input.cs deleted file mode 100644 index 01db4d5..0000000 --- a/src/DotNetHack/Input.cs +++ /dev/null @@ -1,197 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; -using System.Threading; - -namespace DotNetHack -{ - /// - /// Input - /// - public static class Input - { - /// - /// Confirmation delegate - /// - /// - /// - public delegate bool Confirm(string aMessage, bool aDefault = true); - - public delegate void RawInputDelegate(Func aFilter, out ConsoleKeyInfo k); - - /// - /// Performs input filtering - /// Pass anonymous filter called "filter" be sure it returns a boolean, filtering will continue until the boolean condition is met. - /// - /// The filtering lambda to use, expression should eval to true - /// Whatever the final keypress was - public static ConsoleKeyInfo Filter(Func aFilter, out ConsoleKeyInfo k) - { - filter_input: - k = Console.ReadKey(true); - if (!aFilter(k)) - goto filter_input; - return k; - } - - /// - /// Get a string from stdin - /// - /// The message to display - /// - public static string GetString(string aMessage = "") - { - UI.Graphics.CursorToLocation(1, 1); - Console.Write(aMessage + ": "); - return Console.ReadLine(); - } - - /// - /// Get a character from stdin. - /// - /// The message to display. - /// The character read. - public static char GetChar(string aMessage = "", bool repeat = false) - { - UI.Graphics.CursorToLocation(1, 1); - Console.Write(aMessage + ": "); - return Console.ReadKey(repeat).KeyChar; - } - - /// - /// GetDirection returns a unit movement. - /// - /// optional message - /// a unit movement. - public static Location3i GetDirection(string aMessage = "") - { - ConsoleKeyInfo tmpInput; - Location3i tmpUnitLocation = new Location3i(0, 0, 0); - - switch (Input.Filter(x => - x.Key == ConsoleKey.LeftArrow || - x.Key == ConsoleKey.RightArrow || - x.Key == ConsoleKey.UpArrow || - x.Key == ConsoleKey.DownArrow, out tmpInput).Key) - { - case ConsoleKey.RightArrow: - tmpUnitLocation.X++; break; - case ConsoleKey.LeftArrow: - tmpUnitLocation.X--; break; - case ConsoleKey.UpArrow: - tmpUnitLocation.Y--; break; - case ConsoleKey.DownArrow: - tmpUnitLocation.Y++; break; - } - - return tmpUnitLocation; - } - - /// - /// GetInt (inplace) - /// Gets an integer from standard input - /// requires that input is definately valid. - /// - /// The out value where the input is stashed. - /// The message to show prior to reading the input. - public static void GetInt(out int aValue, string aMessage = "#: ") - { - redo_get_int: - UI.Graphics.CursorToLocation(1, 1); - Console.Write(aMessage); - if (!int.TryParse(Console.ReadLine(), out aValue)) - goto redo_get_int; - } - - /// - /// Gets a colour from standard input using a mix of reflection and string comparison. - /// - /// The Colour inputted. - public static Colour GetColour() - { - bool bgSet = false; - bool fgSet = false; - ConsoleColor fg = ConsoleColor.Gray; - ConsoleColor bg = ConsoleColor.Black; - - redo_get_colour: - - try - { - // User input, via text. - UI.Graphics.CursorToLocation(1, 1); - Console.Write("FG: "); - string fgColourStr = Console.ReadLine(); - UI.Graphics.CursorToLocation(1, 1); - Console.Write("BG: "); - string bgColourStr = Console.ReadLine(); - - foreach (var f in typeof(ConsoleColor).GetFields()) - { - // foreground colour - if (f.Name.Equals(fgColourStr)) - { - fg = (ConsoleColor)f.GetValue(f); - fgSet = true; - } - - // background colour. - if (f.Name.Equals(bgColourStr)) - { - bg = (ConsoleColor)f.GetValue(f); - bgSet = true; - } - - if (fgSet && bgSet) - break; - } - - // Return the hopefully good colour. - return new Colour(fg, bg); - } - catch { goto redo_get_colour; } - } - - /// - /// GetInt - /// - /// Gets an integer from standard input. - /// The value read. - public static int GetInt(string aMessage = "#:") - { - redo_get_int: - int tmpVal = 0; - UI.Graphics.CursorToLocation(1, 1); - Console.Write(aMessage); - if (!int.TryParse(Console.ReadLine(), out tmpVal)) - goto redo_get_int; - return tmpVal; - } - - /// - /// ReadStats, read a full out stats object from standard-in. - /// This is only for properties that *can* be read. - /// - /// - public static Stats ReadStats() - { - // Get all properties for a stats object and set them via user input. - Stats retVal = new Stats(); - foreach (var p in typeof(Stats).GetProperties()) - { - if (p.CanWrite) - { - var pSet = p.GetSetMethod(); - pSet.Invoke(retVal, new object[] { Input.GetInt(p.Name + ": ") }); - } - - UI.Graphics.CursorToLocation(1, 1); - Console.Write(" "); - } - - return retVal; - } - } -} diff --git a/src/DotNetHack/Properties/AssemblyInfo.cs b/src/DotNetHack/Properties/AssemblyInfo.cs index 3188a09..ad16046 100644 --- a/src/DotNetHack/Properties/AssemblyInfo.cs +++ b/src/DotNetHack/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DotNetHack")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("DotNetHack")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9a8f21ef-12dd-447a-9d7c-212abbfd7f7b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DotNetHack")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DotNetHack")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a86db38e-bcad-4930-b218-7e6e168511c3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DotNetHack/RuntimeEnviornment.cs b/src/DotNetHack/RuntimeEnviornment.cs deleted file mode 100644 index d20adb9..0000000 --- a/src/DotNetHack/RuntimeEnviornment.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.IO; -namespace DotNetHack -{ - /// - /// The RuntimeEnviornment is comprised of the various settings used - /// at run-time. Debugging switches, directories, etc. - /// - public static class R - { - /// - /// Static .ctor - /// - static R() { Random = new Random(); } - - /// - /// IsDebug can be used to determine if realtile debugging has been - /// enabled. This is not to be confused with conditional compilation symbols. - /// - public static bool IsDebug { get; set; } - - /// - /// The working directory for DNH. - /// - public static string WorkingDirectory { get; set; } - - /// - /// ParseArgs - /// - public static void ParseArgs(string[] argv) - { - const string ARG__DEBUG = "-d"; - foreach (string s in argv) - if (s.Equals(ARG__DEBUG)) - R.IsDebug = true; -#if DEBUG - // Until something better comes along. - R.WorkingDirectory = @"..\..\..\..\"; - - InitializePath(R.WorkingDirectory); - InitializePath(R.DatDirectory); - InitializePath(R.DatSoundsDirectory); -#endif - } - - public static string DatSoundsDirectory - { - get { return Path.Combine(DatDirectory, DAT_SOUNDS_FOLDER); } - } - - public static string DatDirectory - { - get { return Path.Combine(WorkingDirectory, DAT_FOLDER); } - } - - public static string MonsterFile - { - get { return Path.Combine(DatDirectory, DAT_MONSTERS); } - } - - public static string ExceptionFile - { - get { return Path.Combine(DatDirectory, LOG_EXCEPTION); } - } - - /// - /// InitializePath. - /// Initializes the working path for DNH. - /// - /// The path to initialize. - static bool InitializePath(string aFullPath) - { - try - { - if (!Directory.Exists(aFullPath)) - Directory.CreateDirectory(aFullPath); - } - catch { return false; } - return true; - } - - const string DAT_FOLDER = "dat"; - const string DAT_SOUNDS_FOLDER = "sounds"; - const string DAT_MONSTERS = "monsters.dat"; - const string LOG_EXCEPTION = "exceptions.log"; - - /// - /// Random - /// - public static Random Random { get; set; } - } -} - diff --git a/src/DotNetHack/UI/CursorState.cs b/src/DotNetHack/UI/CursorState.cs deleted file mode 100644 index 6f27237..0000000 --- a/src/DotNetHack/UI/CursorState.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.UI -{ - /// - /// CursorState, - /// Basic cursor information. - /// - public class CursorState - { - /// - /// Static constructor; mainly for the CursorStateStack. - /// - static CursorState() { CursorStateStack = new Stack(); } - - /// - /// Create a new CursorState object - /// - /// x-coordinate - /// y-coordindate - /// foreground colour - /// background colour - public CursorState(int x, int y, ConsoleColor fg, ConsoleColor bg) - { - X = x; Y = y; FG = fg; BG = bg; - } - - /// - /// the x-coordinate - /// - public int X { get; set; } - - /// - /// the y-coordinate - /// - public int Y { get; set; } - - /// - /// the background colour - /// - public ConsoleColor BG { get; set; } - - /// - /// The foreground colour - /// - public ConsoleColor FG { get; set; } - - /// - /// Returns the current cursor state as known by the system Console object. - /// - public static CursorState CurrentCursorState - { - get - { - return new CursorState(Console.CursorLeft, Console.CursorTop, - Console.ForegroundColor, Console.BackgroundColor); - } - } - - #region Cursor State Stack - - /// - /// Push the cursor state - /// - public static void PushCursorState() - { - CursorStateStack.Push(CurrentCursorState); - } - - /// - /// Pops the cursor state - /// - public static void PopAndSetCursorState() - { - if (CursorStateStack.Count <= 0) - return; - CursorStateStack.Pop().Set(); - } - - /// - /// CursorStateStack - /// - static Stack CursorStateStack { get; set; } - - #endregion - } -} diff --git a/src/DotNetHack/UI/Display.cs b/src/DotNetHack/UI/Display.cs deleted file mode 100644 index 564ba9c..0000000 --- a/src/DotNetHack/UI/Display.cs +++ /dev/null @@ -1,443 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; -using DotNetHack.Game.Dungeon; - -namespace DotNetHack.UI -{ - /// - /// Graphics - /// - public partial class Graphics - { - /// - /// MessageBox - /// - public static class MessageBox - { - /// - /// Show - /// - /// The title of the message box - /// The message - public static void Show(string aTitle, Exception ex) { Show(aTitle, ex.Message); } - - /// - /// YesNo Box - /// - public static bool YesNo(string aMessage = "") - { - const string YES_NO = "[Y/N]: "; - - // Draw MessageBox - const int WIDTH_OFFSET = 2; - Console.ForegroundColor = ConsoleColor.White; - Console.BackgroundColor = ConsoleColor.Blue; - - Location2i ynBoxLocation = Graphics.ScreenCenter; - aMessage = string.Format(" {0} ", aMessage); - int messagePadding = 2; - int borderWidth = 1; - int mWidth = messagePadding + YES_NO.Length + aMessage.Length + messagePadding + borderWidth; - int mHeight = messagePadding + messagePadding + borderWidth; - - ynBoxLocation.X -= mWidth / 2; - ynBoxLocation.Y -= mHeight / 2; - - Display.Box(ynBoxLocation.X, ynBoxLocation.Y, mWidth, mHeight); - - ynBoxLocation.X++; - - Location2i tmpLoc = ynBoxLocation; - - string spacer = ""; - for (int ix = 0; ix < mWidth - WIDTH_OFFSET; ++ix) - spacer += " "; - - Console.SetCursorPosition(ynBoxLocation.X, ynBoxLocation.Y + 2); - Console.Write(spacer); - - Console.SetCursorPosition(ynBoxLocation.X, ynBoxLocation.Y + 4); - Console.Write(spacer); - - Console.SetCursorPosition(tmpLoc.X, tmpLoc.Y + 3); - Console.Write(spacer); - - Console.SetCursorPosition(tmpLoc.X, tmpLoc.Y + 3); - Console.Write(aMessage); - - Console.SetCursorPosition(tmpLoc.X + ((mWidth / 2) - 3), tmpLoc.Y + 4); - Console.ForegroundColor = ConsoleColor.Blue; - Console.BackgroundColor = ConsoleColor.White; - Console.Write(YES_NO); - - Console.SetCursorPosition(tmpLoc.X + ((mWidth / 2) - 3) + YES_NO.Length - 1, tmpLoc.Y + 4); - - // Handle Y/N logic - int x_loc = Console.CursorLeft; - int y_loc = Console.CursorTop; - redo_yes_no: - var input = Console.ReadKey(); - switch (input.Key) - { - case ConsoleKey.Y: - Console.ResetColor(); - return true; - case ConsoleKey.N: - Console.ResetColor(); - return false; - default: - Console.SetCursorPosition(x_loc, y_loc); - goto redo_yes_no; - } - } - - /// - /// Show - /// - /// The title of the message box - /// The message - public static void Show(string aTitle, string aMessage) - { - const int WIDTH_OFFSET = 2; - Console.ForegroundColor = ConsoleColor.White; - Console.BackgroundColor = ConsoleColor.Blue; - - // Intentionally pad message - aMessage = string.Format(" {0} ", aMessage); - - if (aMessage.Length > UI.Graphics.ScreenWidth - 20) - aMessage = aMessage.Substring(0, UI.Graphics.ScreenWidth - 20); - - int mBoxWidth = WIDTH_OFFSET; int mBoxHeight = 5; - int mTitleLength = aTitle.Length; - int mMessageLength = aMessage.Length; - - Location2i mBoxLocation = Graphics.ScreenCenter; - - if (aTitle.Length > mMessageLength) - mBoxWidth += mTitleLength; - else mBoxWidth += mMessageLength; - - mBoxLocation.X -= (mBoxWidth / 2); - mBoxLocation.Y -= (mBoxHeight / 2); - - string spacer = ""; - for (int ix = 0; ix < mBoxWidth - WIDTH_OFFSET; ++ix) - spacer += " "; - - Display.Box(aTitle, mBoxLocation.X, mBoxLocation.Y, mBoxWidth, mBoxHeight); - - mBoxLocation.X++; - - Location2i tmpLoc = mBoxLocation; - - Console.SetCursorPosition(mBoxLocation.X, mBoxLocation.Y + 2); - Console.Write(spacer); - - Console.SetCursorPosition(mBoxLocation.X, mBoxLocation.Y + 4); - Console.Write(spacer); - - Console.SetCursorPosition(tmpLoc.X, tmpLoc.Y + 3); - Console.Write(aMessage); - - Console.SetCursorPosition(tmpLoc.X + ((mBoxWidth / 2) - 3), tmpLoc.Y + 4); - Console.ForegroundColor = ConsoleColor.Blue; - Console.BackgroundColor = ConsoleColor.White; - Console.Write("["); Console.Write("Ok"); Console.Write("]"); - - Console.ReadKey(); - Console.ResetColor(); - } - } - - /// - /// Display - /// - public static class Display - { - const ConsoleColor SOUND_COLOUR = ConsoleColor.Cyan; - - /// - /// Show sound - /// - /// The sound to show. - public static void ShowSound(Sound aSound) - { - string strSoundDisplay = string.Format("[{0}]", aSound.SoundDescription); - - CullMessageByLastMessage(strSoundDisplay); - - CursorToLocation(1, 0); - - Colour previousColour = Colour.CurrentColour; - - Console.ForegroundColor = SOUND_COLOUR; - - Console.Write(strSoundDisplay); - } - - /// - /// ShowMessage - /// - /// A composite format string. - /// Parameters - public static void ShowMessage(string aFormatString, - params object[] aArgs) - { - // determine what the display string ends up being. - string tmpDisplayString = string.Format(aFormatString, aArgs); - - CullMessageByLastMessage(tmpDisplayString); - - // Jump back over to starting location. - CursorToLocation(1, 0); - - // Write the display string. - Console.Write(tmpDisplayString); - - // Capture the last string size. - _lastStringSize = tmpDisplayString.Length; - } - - /// - /// CullMessageByLastMessage, smartly set _lastStringSize - /// - /// The display string to factor in - private static void CullMessageByLastMessage(string tmpDisplayString) - { - // If the size of the last string is greater than this one, - // overwrite what was there with nothing. - if (_lastStringSize > tmpDisplayString.Length) - { - CursorToLocation(1, 0); - for (int c = 0; c < _lastStringSize; ++c) - Console.Write(' '); - } - } - - static int _lastStringSize = 0; - - public static void ShowStatsBar(Player aPlayer) - { - Colour.Standard.Set(); - - StatsBase aStats = aPlayer.CommutedStats(); - Stats statsBase = aPlayer.Stats; - - string strPlayerInfo = string.Format( - "{0}, {1}, (hp){2}/{3}, (Ma){4}/{5}, {6}", - aPlayer.Name, - aPlayer.Wallet, - aPlayer.Stats.Health, - aPlayer.Stats.HitPoints, - aPlayer.Stats.Mana, - aPlayer.Stats.ManaPoints, - GameEngine.Time - ); - - Console.SetCursorPosition(0, Console.WindowHeight - 2); - Console.Write(strPlayerInfo); - Console.SetCursorPosition(0, Console.WindowHeight - 1); - ShowStat("Str", statsBase.Strength, aStats.Strength); - ShowStat("Per", statsBase.Perception, aStats.Perception); - ShowStat("End", statsBase.Endurance, aStats.Endurance); - ShowStat("Chr", statsBase.Charisma, aStats.Charisma); - ShowStat("Int", statsBase.Intelligence, aStats.Intelligence); - ShowStat("Agi", statsBase.Agility, aStats.Agility); - ShowStat("Luck", statsBase.Luck, aStats.Luck); - } - - private static void ShowStat(string aStat, int lhs, int rhs) - { - if (rhs > 0) - { - Console.ForegroundColor = ConsoleColor.Green; - Console.Write("{0}:{1} ", aStat, lhs + rhs); - } - else if (rhs < 0) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write("{0}:{1} ", aStat, lhs + rhs); - } - else - { - Console.ForegroundColor = ConsoleColor.White; - Console.Write("{0}:{1} ", aStat, lhs); - } - } - - /// - /// Box - /// - /// The menu - /// X-Coord - /// Y-Coord - public static void Box(Menu aMenu, int x, int y) - { - int w = aMenu.Title.Length; int h = 0; - int max_name_length = 0; - foreach (var action in aMenu.MenuActions) - if (action.Name.Length > max_name_length) - max_name_length = action.Name.Length; - w = max_name_length + 7; - h = aMenu.MenuActions.Count() + 2; - Box(aMenu.Title, x, y, w, h); - ++y; ++x; int c = 0; // top right - Console.SetCursorPosition(x, y); - foreach (var action in aMenu.MenuActions) - { - string tmpPad = string.Empty; - for (int padIndex = 0; padIndex < Math.Abs(action.Name.Length - w) - 7; ++padIndex) - tmpPad += " "; - - // change colour(s) for the selected item. - if (aMenu.SelectorLocation.Y == y) - aMenu.SelectedColour.Set(); - - Console.Write("({0}). {1}", c, action.Name + tmpPad); - - // reset to normal - aMenu.MenuColour.Set(); - - Console.SetCursorPosition(x, ++y); - ++c; - } - string tmpPad1 = string.Empty; - for (int padIndex = 2; padIndex < w; ++padIndex) - tmpPad1 += " "; - Console.Write(tmpPad1); - Console.SetCursorPosition(x, y++); - Console.Write(tmpPad1); - - - } - - /// - /// Box - /// - /// The Title - /// The X-Coordinate - /// The Y-Coordinate - /// The Width. - /// The Height. - /// Right Align? - public static void Box(string aTile, int x, int y, int w, int h, bool ralign) - { - if (!ralign) - Box(aTile, x, y, w, h); - else Box(aTile, Console.WindowWidth - (((aTile.Length > w ? aTile.Length + 2 : w)) + x), y, w, h); - } - - /// - /// Draw a bounding box around a display region. - /// - /// The display region to draw a bounding box around. - public static void Box(DisplayRegion dr) - { - Box(dr.P1.X, dr.P1.Y, dr.P2.X, dr.P2.Y); - } - - /// - /// Box - /// - /// The Title - /// The X-Coordinate - /// The Y-Coordinate - /// The Width. - /// The Height. - public static void Box(string aTitle, int x, int y, int w, int h) - { - int l = aTitle.Length; - if (l < w) - { - Box(x, y, w, h); - Console.SetCursorPosition(x + ((w / 2) - (l / 2)), y); - Console.Write(aTitle); - } - else Box(aTitle, x, y, l + 2, h); - } - - /// - /// DisplayRefresh - /// - /// The dungeon used for determining data to clear - /// The location for determing the dungeon level to use in refreshing. - public static void Refresh(Dungeon3 aDungeon, Location3i aLocation) - { - if (PostRedisplay != null) - PostRedisplay(aDungeon, aLocation); - } - - /// - /// PostRedisplay, should only be wired up to clear one area at a time. A multicast del - /// is not used. - /// - static Func PostRedisplay = null; - - /// - /// Box - /// - /// The X-Coordinate - /// The Y-Coordinate - /// The Width. - /// The Height. - public static void Box(int x, int y, int w, int h) - { - // wire up the post redisplay callback. - PostRedisplay = delegate(Dungeon3 dungeon, Location3i l) - { - if (dungeon == null || l == null) - throw new ApplicationException("PostRedisplay Failed!"); - var displayRegion = new DisplayRegion(x, y, x + w, y + h); - dungeon.DungeonRenderer.RefreshBufferedRegion(l, displayRegion); - return displayRegion; - }; - - if (w <= 2) - throw new ArgumentException( - string.Format("Display box width must be greater than 2. Was {0}.", w)); - - for (int c = 0; c < w; ++c) - { - Console.SetCursorPosition(x + c, y); - if (c == 0) - Console.Write('╔'); - else if (c == w - 1) - Console.Write('╗'); - else - Console.Write('═'); - } - for (int c = 1; c < h; ++c) - { - Console.SetCursorPosition(x, y + c); - Console.Write('║'); - Console.SetCursorPosition(x + w - 1, y + c); - Console.Write('║'); - } - for (int c = 0; c < w; ++c) - { - Console.SetCursorPosition(x + c, y + h); - if (c == 0) - Console.Write('╚'); - else if (c == w - 1) - Console.Write('╝'); - else - Console.Write('═'); - } - - string spacer = string.Empty; - for (int c = 0; c < w - 2; ++c) - spacer += " "; - - for (int c = 1; c < h; ++c) - { - Console.SetCursorPosition(x + 1, y + 1); - Console.Write(spacer); - } - } - } - } -} diff --git a/src/DotNetHack/UI/DisplayRegion.cs b/src/DotNetHack/UI/DisplayRegion.cs deleted file mode 100644 index c7c894e..0000000 --- a/src/DotNetHack/UI/DisplayRegion.cs +++ /dev/null @@ -1,32 +0,0 @@ - -using DotNetHack.Game; -using DotNetHack.Utility; - -namespace DotNetHack.UI -{ - /// - /// BufferedRegion - /// - public class DisplayRegion : Rectangle - { - /// - /// Creates a new buffered region. - /// - /// The first point used for form the region - /// The second point used to for the region. - public DisplayRegion(Location2i a, Location2i b) - : base(a, b) - { } - - /// - /// Creates a new buffered region. - /// - /// x-coord of the first point used to form the region - /// y-coord of the first point used to form the region - /// x-coord of the second point used to form the region - /// y-coord of the second point used to form the region - public DisplayRegion(int x1, int y1, int x2, int y2) - : base(x1, y1, x2, y2) - { } - } -} diff --git a/src/DotNetHack/UI/Graphics.cs b/src/DotNetHack/UI/Graphics.cs deleted file mode 100644 index ce82163..0000000 --- a/src/DotNetHack/UI/Graphics.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using DotNetHack.Game; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.UI -{ - /// - /// Graphics - /// - public static partial class Graphics - { - /// - /// extension method allowing a CursorState to be set right off the bat. - /// - /// the cursor state to set effective immediate - public static void Set(this CursorState value) - { - Console.SetCursorPosition(value.X, value.Y); - Console.ForegroundColor = value.FG; - Console.BackgroundColor = value.BG; - } - - /// - /// Initialize - /// - public static void Initialize() - { - Initialize(Console.WindowWidth, - Console.WindowHeight); - } - - /// - /// Initialize - /// - public static void Initialize(int w, int h) - { - // Kill cursor visibility - Console.CursorVisible = false; - Console.SetWindowSize(w, h); - } - - /// - /// ShowGraphicsInfo - /// - public static void ShowGraphicsInfo() - { - Console.WriteLine("Width: {0}, Height: {1}", - Console.WindowWidth, Console.WindowHeight); - Console.WriteLine("Max-Width: {0}, Max-Height: {1}", - Console.LargestWindowWidth, Console.LargestWindowHeight); - } - - /// - /// ScreenCenter - /// The location of the center of the screen. - /// - public static Location2i ScreenCenter - { - get - { - return new Location2i(Console.WindowWidth / 2, - Console.WindowHeight / 2); - } - } - - /// - /// The width of the screen. - /// - public static int ScreenWidth { get { return Console.WindowWidth; } } - - /// - /// The height of the screen. - /// - public static int ScreenHeight { get { return Console.WindowHeight; } } - - /// - /// Clear - /// - public static void Clear(Colour aColour) - { - Console.BackgroundColor = aColour.FG; - Console.ForegroundColor = aColour.BG; - Console.Clear(); - } - - /// - /// Clear - /// - public static void Clear() { Clear(Colour.Standard); } - - /// - /// Clear the passed display region - /// - /// - public static void Clear(DisplayRegion dr) - { - for (int x = dr.P1.X; x < dr.P2.X; ++x) - for (int y = dr.P1.Y; y < dr.P2.Y; ++y) - { - UI.Graphics.CursorToLocation(x, y); - Console.Write(' '); - } - } - - /// - /// Draw - /// - /// A drawable object or thing - public static void Draw(IDrawable aDrawable) - { - // Move the cursor to the drawble location. - CursorToLocation(aDrawable.Location); - - // Save this for later - Colour tmpColor = Colour.CurrentColour; - - // we're not coming this far to findout a colour isn't set. - if (aDrawable.C == null) - aDrawable.C = Colour.Standard; - - // Set the colour - aDrawable.C.Set(); - - // Draw the character - Console.Write(aDrawable.G); - - // Set the colour back to what we saved at the beginning of the method. - tmpColor.Set(); - } - - /// - /// CursorToLocation brings the cursor to the specified location. - /// - /// The location to bring the cursor to. - public static void CursorToLocation(Location2i aLocation) - { - CursorToLocation(aLocation.X, aLocation.Y); - } - - /// - /// CursorToLocation brings the cursor to the specified location. - /// - /// The X-Coordinate - /// The Y-Coordinate - public static void CursorToLocation(int x, int y) - { - Console.SetCursorPosition(x, y); - } - } -} - diff --git a/src/DotNetHack/UI/Menu.cs b/src/DotNetHack/UI/Menu.cs deleted file mode 100644 index f337628..0000000 --- a/src/DotNetHack/UI/Menu.cs +++ /dev/null @@ -1,214 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.UI -{ - /// - /// - /// - public class Menu - { - /// - /// - /// - /// - /// - public Menu(string aTile, MenuAction[] aActions, Colour aColour = null) - { - // set menu actions, set title. - MenuActions = aActions; Title = aTile; - - // init menu colour - MenuColour = aColour ?? Colour.Standard; - - // selected colour is passed colour but negated. - SelectedColour = !MenuColour; - } - - /// - /// - /// - public string Title { get; set; } - - /// - /// MenuColour - /// - public Colour MenuColour { get; set; } - - /// - /// The item selected colour. - /// - public Colour SelectedColour { get; set; } - - /// - /// Show this menu at the passed location - /// - /// x-coordinate for menu - /// y-coordinate for menu - public void Show(int x, int y) - { - // remember location, remember we've shown the menu. - MenuShown = true; - MenuLocation = new Location2i(x, y); - - MenuColour.FG = ConsoleColor.White; - MenuColour.BG = ConsoleColor.Blue; - - MenuColour.Set(); - - #region init selector location & selector colour - - // WARNING: Show() is called repeatedly, don't init this value - // more than one time, otherwise SelectorLocation is over-written. - if (SelectorLocation == null) - { - SelectorLocation = new Location2i(MenuLocation); - SelectorLocation.X++; - SelectorLocation.Y++; - } - - #endregion - - // display.box knows how to draw a menu. - Graphics.Display.Box(this, x, y); - } - - /// - /// Show this menu at the passed location - /// - /// The to shown menu @ - public void Show(Location2i l) { Show(l.X, l.Y); } - - /// - /// Exec - /// - /// - public virtual void Exec(object argv) - { - int selector = 0x00; - bool done = false; - - // if the menu has not already been shown, calling exec makes no sense. - if (!MenuShown) - throw new DNHackException("Cannot call Menu.Exec() before Menu.Show()."); - - do - { - var input = Console.ReadKey(true); - - switch (input.Key) - { - case ConsoleKey.Enter: - // wire into the MenuAction array via selector offset and - // execute the associated action. - MenuActions[selector].MAction(argv); - return; - - // other keys don't do anything. - default: break; - - // "escape" will exit the menu. - case ConsoleKey.Escape: - done = true; - break; - - // All keys associated with moving "up". - case ConsoleKey.RightArrow: - case ConsoleKey.UpArrow: - case ConsoleKey.PageUp: - selector++; - break; - - // All keys associated with moving "down". - case ConsoleKey.LeftArrow: - case ConsoleKey.DownArrow: - case ConsoleKey.PageDown: - selector--; - break; - } - - // keep selector within array bounds & non-negative. - selector %= MenuActions.Length; - if (selector < 0) - selector = MenuActions.Length - 1; // loop around. - - // set menu selector location. - SelectorLocation.Y = selector + MenuLocation.Y + 1; - - // re-draw the menu; this will update MenuSelection display too. - Show(MenuLocation); - - } while (!done); - } - - /* - public virtual void Exec(object argv) - { - var input = Console.ReadKey(); - if (input.Key == ConsoleKey.Escape) - return; - foreach (MenuAction mAction in MenuActions) - if (mAction.MenuActionFilter(input)) - mAction.MAction(argv); - return; - }*/ - - - /// - /// - /// - public MenuAction[] MenuActions { get; set; } - - /// - /// MActionDelegate - /// - /// - public delegate void MActionDelegate(object argv); - - /// - /// MenuLocation - /// - public Location2i MenuLocation { get; private set; } - - /// - /// SelectorLocation - /// - public Location2i SelectorLocation { get; private set; } - - /// - /// Set to true when the menu is shown. Can be used to determine if - /// it's already been drawn. - /// - private bool MenuShown = false; - - /// - /// MenuAction - /// - public struct MenuAction - { - /// - /// Name - /// - public string Name { get; set; } - - /// - /// ConsoleKey - /// - public string ConsoleKey { get; set; } - - /// - /// MAction - /// - public MActionDelegate MAction { get; set; } - - /// - /// - /// - public Func MenuActionFilter { get; set; } - } - } -} diff --git a/src/DotNetHack/UI/ProgressBar.cs b/src/DotNetHack/UI/ProgressBar.cs deleted file mode 100644 index 1e50bf6..0000000 --- a/src/DotNetHack/UI/ProgressBar.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.UI -{ - /// - /// ProgressBar - /// - public class ProgressBar : Widget - { - /// - /// Creates a new instance of ProgressBar - /// - public ProgressBar(string text) - : this(text, 1, 1) { } - - /// - /// Creates a new instance of - /// - /// The inner text - /// x-coordinate - /// y-coordinate - public ProgressBar(string text, int x, int y, double v = 0.0) - : base(x, y, DefaultWidth, 1) - { - Value = v; - Text = text; - - // init progress-bar colour scheme - TC = ConsoleColor.Yellow; - BG = ConsoleColor.Cyan; - FG = ConsoleColor.Black; - } - - /// - /// Draw - /// - public override void Show() - { - CursorState.PushCursorState(); - - base.Show(); - - // set-up the colour scheme - Console.ForegroundColor = FG; - Console.BackgroundColor = BG; - - // actually perform the drawing mechanicially - for (int index = 0; index < Width; index++) - { - // deliniate progress using colour. - if (index > (Width / 100.0) * Value && Value > 0) - Console.BackgroundColor = TC; - else if (Value >= 100.0) - Console.BackgroundColor = TC; - - // draw the text - if (index > TextOffset) - { - int offset = index - TextOffset - 1; - if (offset < Text.Length) - { - var tmpFG1 = Console.ForegroundColor; - Console.ForegroundColor = FG; - Console.Write(Text[offset]); - Console.ForegroundColor = tmpFG1; - } - } - - // write a specific charcter to the screen - // ' running ' - Console.Write(DisplayGlyph); - Console.SetCursorPosition(X + index, Y); - } - - CursorState.PopAndSetCursorState(); - } - - /// - /// the text offset is used in positioning calculations. - /// - int TextOffset { get { return ((Width / 2)) - (Text.Length / 2); } } - - /// - /// The text displayed inside of the progress bar - /// - public string Text { get; set; } - - /// - /// the current percentage as represented by this progress bar. - /// - public double Value { get; set; } - - /// - /// Padding on both the left and right side of progress bar. - /// - const int Padding = 2; - - /// - /// the default width for any progress bar. - /// - const int DefaultWidth = 20; - - /// - /// the character used for displaying percentage complete - /// - const char DisplayGlyph = ' '; - - /// - /// foreground colour, generally text for a progress bar - /// - readonly ConsoleColor FG; - - /// - /// the background colour - /// - readonly ConsoleColor BG; - - /// - /// a third colour, for % that has been completed - /// - readonly ConsoleColor TC; - } -} diff --git a/src/DotNetHack/UI/Symbols.cs b/src/DotNetHack/UI/Symbols.cs deleted file mode 100644 index 10c6047..0000000 --- a/src/DotNetHack/UI/Symbols.cs +++ /dev/null @@ -1,357 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace DotNetHack.UI -{ - public static class Symbols - { - - // ƒ - - /// - /// ≡ - /// - public const char MOD_EQUAL = '≡'; - - /// - /// ░ - /// - public const char FILL_LIGHT = '░'; - - /// - /// ▒ - /// - public const char FILL_MEDIUM = '▒'; - - /// - /// ▓ - /// - public const char FILL_HEAVY = '▓'; - - /// - /// At symbol - /// - public const char AT_SYMBOL = '@'; - - /// - /// ↓ - /// - public const char ARROW_DOWN = '↓'; - - /// - /// ▲ - /// - public const char ARROW_UP = '↑'; - - /// - /// ♥ - /// - public const char HEART = '♥'; - - /// - /// ♦ - /// - public const char DIAMOND = '♦'; - - - /// - /// ♣ - /// - public const char CLUB = '♣'; - - /// - /// ○ - /// - public const char CIRCLE = '○'; - - /// - /// ♂ - /// - public const char MARS = '♂'; - - - /// - /// ♀ - /// - public const char VENUS = '♀'; - - /// - /// § - /// - public const char SECTION = '§'; - - /// - /// ♪ - /// - public const char MUSIC_1 = '♪'; - - /// - /// ♫ - /// - public const char MUSIC_2 = '♫'; - - /// - /// ☼ - /// - public const char SUN = '☼'; - - /// - /// α - /// - public const char ALPHA = 'α'; - - /// - /// ß - /// - public const char ESZETT = 'ß'; - - /// - /// π - /// - public const char PI = 'π'; - - /// - /// Σ - /// - public const char SUM = 'Σ'; - - /// - /// σ - /// - public const char RO = 'σ'; - - /// - /// ∞ - /// - public const char INFINITY = '∞'; - - /// - /// Ω - /// - public const char OMEGA = 'Ω'; - - /// - /// █ - /// - public const char SOLID = '█'; - - /// - /// µ - /// - public const char MU = 'µ'; - - /// - /// ≈ - /// - public const char ALMOST_EQUAL = '≈'; - - /// - /// ╋ - /// - public const char W_THICK_4_WAY_JUNCTION = '╋'; - - /// - /// ┼ - /// - public const char W_THIN_4_WAY_JUNCTION = '┼'; - - /// - /// ┘ - /// - public const char W_THIN_BOTTOM_RIGHT = '┘'; - - /// - /// └ - /// - public const char W_THIN_BOTTOM_LEFT = '└'; - - /// - /// ┌ - /// - public const char W_THIN_TOP_LEFT = '┌'; - - /// - /// ┐ - /// - public const char W_THIN_TOP_RIGHT = '┐'; - - /// - /// ─ - /// - public const char W_THIN_HORIZONTAL = '─'; - - /// - /// │ - /// - public const char W_THIN_VERTICAL = '│'; - - /// - /// ┤ - /// - public const char W_THIN_VERTICAL_RIGHT_JUNCTION = '┤'; - - /// - /// ├ - /// - public const char W_THIN_VERTICAL_LEFT_JUNCTION = '├'; - - /// - /// ┴ - /// - public const char W_THIN_HORIZONTAL_UP_JUNCTION = '┴'; - - /// - /// ┴ - /// - public const char W_THIN_HORIZONTAL_DOWN_JUNCTION = '┬'; - - /// - /// ═ - /// - public const char W_DBL_HORIZONTAL = '═'; - - /// - /// ║ - /// - public const char W_DBL_VERTICAL = '║'; - - /// - /// ╚ - /// - public const char W_DBL_BOTTOM_LEFT = '╚'; - - /// - /// ╝ - /// - public const char W_DBL_BOTTOM_RIGHT = '╝'; - - /// - /// ╗ - /// - public const char W_DBL_TOP_RIGHT = '╗'; - - /// - /// ╔ - /// - public const char W_DBL_TOP_LEFT = '╔'; - - /// - /// ╬ - /// - public const char W_DBL_4_WAY = '╬'; - - /// - /// ╠ - /// - public const char W_DBL_V_LEFT_JUNC = '╠'; - - /// - /// ╣ - /// - public const char W_DBL_V_RIGHT_JUNC = '╣'; - - /// - /// ╩ - /// - public const char W_DBL_BOT_T_JUNC = '╩'; - - /// - /// ╦ - /// - public const char W_DBL_TOP_T_JUNC = '╦'; - - - /// - /// ╫ - /// - public const char W_DBLSGL_VH = '╫'; - - /// - /// ╒ - /// - public const char W_DBLSGL_TOP_LEFT = '╒'; - - /// - /// ╘ - /// - public const char W_DBLSGL_BOT_LEFT = '╘'; - - /// - /// ╕ - /// - public const char W_DBLSGL_TOP_RIGHT = '╕'; - - /// - /// ╓ - /// - public const char W_SGLDBL_TOP_LEFT = '╓'; - - /// - /// ╖ - /// - public const char W_SGLDBL_TOP_RIGHT = '╖'; - - /// - /// ╜ - /// - public const char W_SGLDBL_BOT_RIGHT = '╜'; - - /// - /// ╛ - /// - public const char W_DBLSGL_BOT_RIGHT = '╛'; - - /// - /// ╞ - /// - public const char W_SGLDBL_V_JUNC_LEFT = '╞'; - - - /// - /// ╨ - /// - public const char W_DBLSGL_BOT_JUNC = '╨'; - - /// - /// ╤ - /// - public const char W_DBLSGL_TOP_JUNC = '╤'; - - /// - /// ƒ - /// - public const char FUNCTION = 'ƒ'; - - /// - /// ¥ - /// - public const char YEN = '¥'; - - /// - /// ◘ - /// - public const char SQUARE_SQUARE = '◘'; - - /// - /// τ - /// - public const char TAU = 'τ'; - - /// - /// t - /// - public const char SMALL_T = 't'; - - /// - /// » - /// - public const char CHEVRON_RIGHT = '»'; - - /// - /// « - /// - public const char CHEVRON_LEFT = '«'; - } -} diff --git a/src/DotNetHack/UI/Widget.cs b/src/DotNetHack/UI/Widget.cs deleted file mode 100644 index 24e3368..0000000 --- a/src/DotNetHack/UI/Widget.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game; - -namespace DotNetHack.UI -{ - /// - /// Left, Right, Center - /// - // public enum HorizontalAlignment { Left, Right, Center } - /// - /// Top, Bottom, Center - /// - // public enum VerticalAlignment { Top, Bottom, Center } - - /// - /// - /// - public enum Align { IOO, OIO, OOI }; - - /// - /// Widget - /// - public class Widget - { - public Widget(int x, int y, int width, int height) - { - X = x; Y = y; Width = width; Height = height; - } - - public event EventHandler OnShow; - - public event EventHandler OnHide; - - public event EventHandler OnUpdate; - - public int X { get; set; } - - public int Y { get; set; } - - public int Width { get; set; } - - public int Height { get; set; } - - public bool IsVisible { get; set; } - - public virtual void Show() - { - IsVisible = true; - Console.SetCursorPosition(X, Y); - if (OnShow != null) - OnShow(this, null); - } - - public virtual void Hide() - { - IsVisible = false; - if (OnHide != null) - OnHide(this, null); - } - - public virtual void Update() - { - if (OnUpdate != null) - OnUpdate(this, null); - } - - public virtual void Refresh() { } - - /// - /// DisplayRegion - /// - public DisplayRegion DisplayRegion - { - get { return new DisplayRegion(X, Y, X + Width, Y + Height); } - } - } -} diff --git a/src/DotNetHack/UI/Window.cs b/src/DotNetHack/UI/Window.cs deleted file mode 100644 index 0a54fc8..0000000 --- a/src/DotNetHack/UI/Window.cs +++ /dev/null @@ -1,138 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game.Events; - -namespace DotNetHack.UI -{ - /// - /// Window - /// - public class Window : Widget - { - /// - /// Occurs when the user scrolls up. - /// - protected event EventHandler OnScrollUp; - - /// - /// Occurs when the user scrolls down. - /// - protected event EventHandler OnScrollDown; - - /// - /// Occurs when the user preses escape. - /// - protected event EventHandler OnEsc; - - /// - /// Occurs when the user presses enter. - /// - protected event EventHandler OnEnter; - - /// - /// Window - /// - /// The title for the window - public Window(string aWindowTitle) - : this(aWindowTitle, 0, 0, Graphics.ScreenWidth, Graphics.ScreenHeight - 1) { } - - /// - /// Window - /// - /// The title of the window to display - /// The x-coordinate for the window. - /// The y-coordinate for the window - /// The width of the window - /// The height of the window. - public Window(string aWindowTitle, int x, int y, - int aWindowWidth, int aWindowHeight) - : base(x, y, aWindowWidth, aWindowHeight) - { - if (aWindowHeight <= 0 || aWindowWidth <= 0) - throw new ArgumentException( - "Window size and coorinates must be greater than zero."); - - WindowTitle = aWindowTitle; - // WindowRegion = new DisplayRegion(x, y, - // x + aWindowWidth, y + (aWindowHeight - 1)); - } - - /// - /// WindowRegion - /// - DisplayRegion WindowRegion { get { return base.DisplayRegion; } } - - /// - /// WindowTitle - /// - public string WindowTitle { get; set; } - - /// - /// WindowWidth - /// - public int WindowWidth - { - get { return Width; } - } - - /// - /// WindowHeight - /// - public int WindowHeight - { - get { return Height; } - } - - /// - /// Show - /// - public override void Show() - { - base.Show(); - UI.Graphics.Clear(WindowRegion); - UI.Graphics.Display.Box(WindowRegion); - Console.SetCursorPosition(WindowRegion.P1.X + 3, WindowRegion.P1.Y); - Console.Write(string.Format("{0} {1} {2}", - Symbols.W_DBL_V_RIGHT_JUNC, WindowTitle, Symbols.W_DBL_V_LEFT_JUNC)); - } - - /// - /// Executes control-input for the widget. Expect events to pipe back the - /// key-press details. - /// - public void Exec() - { - ConsoleKeyInfo tmpConsoleKey; - switch (Input.Filter( - k => k.Key == ConsoleKey.PageDown || - k.Key == ConsoleKey.PageUp || - k.Key == ConsoleKey.UpArrow || - k.Key == ConsoleKey.DownArrow || - k.Key == ConsoleKey.Enter || - k.Key == ConsoleKey.Escape, out tmpConsoleKey).Key) - { - case ConsoleKey.PageUp: - case ConsoleKey.UpArrow: - if (OnScrollDown != null) - OnScrollDown(this, new KeyPressEventArgs(tmpConsoleKey)); - break; - case ConsoleKey.DownArrow: - case ConsoleKey.PageDown: - if (OnScrollUp != null) - OnScrollUp(this, new KeyPressEventArgs(tmpConsoleKey)); - break; - case ConsoleKey.Escape: - if (OnEsc != null) - OnEsc(this, new KeyPressEventArgs(tmpConsoleKey)); - break; - case ConsoleKey.Enter: - if (OnEnter != null) - OnEnter(this, new KeyPressEventArgs(tmpConsoleKey)); - break; - } - } - } -} diff --git a/src/DotNetHack/UI/Windows/WindowCharacterSheet.cs b/src/DotNetHack/UI/Windows/WindowCharacterSheet.cs deleted file mode 100644 index 9571d17..0000000 --- a/src/DotNetHack/UI/Windows/WindowCharacterSheet.cs +++ /dev/null @@ -1,199 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; -using DotNetHack.Game.Items.Equipment.Armor; -using DotNetHack.Game.Interfaces; - -namespace DotNetHack.UI.Windows -{ - /// - /// - /// - public class WindowCharacterSheet : Window - { - /// - /// Create a new character sheet for the supplied actor. - /// - /// The supplied actor - public WindowCharacterSheet(Actor aActor) - : base("Character Sheet for \"" + aActor.Name + "\" (lvl." + - aActor.Stats.Level + ")") - { - Character = aActor; - - } - - /// - /// show the character sheet. - /// - public override void Show() - { - // called first - base.Show(); - - int y_coord = 0; - - var xStats = Character.WornArmour.CommutedStats(x => x.Condition > 0); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Mana: {0}", Character.Stats.ManaPoints); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Health: {0}", Character.Stats.HitPoints); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Armour: {0}", Character.Stats.ArmourClass); - - y_coord++; - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Strength: {0}+{1}", Character.Stats.Strength, xStats.Strength); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Perception: {0}+{1}", Character.Stats.Perception, xStats.Perception); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Endurance: {0}+{1}", Character.Stats.Endurance, xStats.Endurance); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Charisma: {0}+{1}", Character.Stats.Charisma, xStats.Charisma); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Intelligence: {0}+{1}", Character.Stats.Intelligence, xStats.Intelligence); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Agility: {0}+{1}", Character.Stats.Agility, xStats.Agility); - - Console.SetCursorPosition(3, 3 + y_coord++); - Console.Write("Luck: {0}+{1}", Character.Stats.Luck, xStats.Luck); - - // skip 1 - y_coord = 0; - - int x_coord = 44; - - - - new ProgressBar("mana", x_coord, 5, - GameEngine.Player.Stats.ManaPercent).Show(); - - new ProgressBar("hp", x_coord, 7, - GameEngine.Player.Stats.HealthPercent).Show(); - - y_coord = 9; - foreach (var a in GameEngine.Player.EffectStack) - { - Console.SetCursorPosition(x_coord, 3 + y_coord++); - Console.Write(a.EffectType); - } - - y_coord = 0; - - Console.SetCursorPosition(x_coord, 3 + y_coord++); - x_coord = 22; - - /// Head, 0 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - IArmour armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.Head); - if (armour != null) - Console.WriteLine("Head: " + armour.Name); - else Console.WriteLine("Head: (none)"); - - /// Neck, 1 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.Neck); - if (armour != null) - Console.WriteLine("Neck: " + armour.Name); - else Console.WriteLine("Neck: (none)"); - armour = null; - - /// Chest, 2 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.Chest); - if (armour != null) - Console.WriteLine("Chest: " + armour.Name); - else Console.WriteLine("Chest: (none)"); - armour = null; - - /// Arms, 3 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.Arms); - if (armour != null) - Console.WriteLine("Arms: " + armour.Name); - else Console.WriteLine("Arms: (none)"); - armour = null; - - /// Hands, 4 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.Hands); - if (armour != null) - Console.WriteLine("Hands: " + armour.Name); - else Console.WriteLine("Hands: (none)"); - armour = null; - - /// Legs, 5 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.Legs); - if (armour != null) - Console.WriteLine("Legs: " + armour.Name); - else Console.WriteLine("Legs: (none)"); - armour = null; - - /// Feet, 6 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.Feet); - if (armour != null) - Console.WriteLine("Feet: " + armour.Name); - else Console.WriteLine("Feet: (none)"); - armour = null; - - /// LeftFinger, 7 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.LeftFinger); - if (armour != null) - Console.WriteLine("LeftFinger: " + armour.Name); - else - Console.WriteLine("LeftFinger: (none)"); - armour = null; - - /// RightFinger, 8 - Console.SetCursorPosition(x_coord, 3 + y_coord++); - armour = null; - armour = Character.WornArmour.GetWornArmourByLocation( - Game.Items.Equipment.Armour.ArmourLocation.RightFinger); - if (armour != null) - Console.WriteLine("RightFinger: " + armour.Name); - else - Console.WriteLine("RightFinger:(none)"); - - armour = null; - - Console.ReadKey(true); - } - - - - /// - /// The character in this character sheet. - /// - Actor Character { get; set; } - } -} diff --git a/src/DotNetHack/UI/Windows/WindowInventory.cs b/src/DotNetHack/UI/Windows/WindowInventory.cs deleted file mode 100644 index 0ae538d..0000000 --- a/src/DotNetHack/UI/Windows/WindowInventory.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; - -namespace DotNetHack.UI.Windows -{ - /// - /// Inventory Window - /// - public class WindowInventory : Window - { - /// - /// Creates a new inventory window. - /// - /// The actor - public WindowInventory(Actor aActor) - : base("Inventory") - { - InventoryActor = aActor; - } - - /// - /// Shows the inventory window. - /// - public override void Show() - { - // base show called first. - base.Show(); - - bool done = false; - int n = 0x00; // index,offset to the first n+1 inventory items - while (!done) - { - // WARNING: Something like this only applies to fullscreen windows - Console.SetCursorPosition(1, 1); - - int index = 0x00; - foreach (var iItem in InventoryActor.Inventory) - { - Console.SetCursorPosition(1, 1 + index + n); - Console.Write("\t{0})\t{1}", index + 1 + n, iItem.Name); - index++; - } - - ConsoleKeyInfo input; - Input.Filter(i => - i.Key == ConsoleKey.PageDown || - i.Key == ConsoleKey.PageUp || - i.Key == ConsoleKey.Escape, out input); - - switch (input.Key) - { - case ConsoleKey.Escape: - done = true; - break; - case ConsoleKey.PageDown: - break; - case ConsoleKey.PageUp: - break; - } - } - } - - /// - /// The actor whos inventory gets shown. - /// - Actor InventoryActor { get; set; } - } -} diff --git a/src/DotNetHack/UML/Concrete.cd b/src/DotNetHack/UML/Concrete.cd deleted file mode 100644 index ef4aa45..0000000 --- a/src/DotNetHack/UML/Concrete.cd +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAA= - Game\Location.cs - - - - - - AAAAEAAAEAACAQEAAAAAAAAFICAAAAAAAAAAAAAAAEA= - Game\Player.cs - - - - - - - AAIACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Items\Containers\LockBox.cs - - - - - - AAIAAAAAAAAACAAAAAAABAQAAAAAAAAAAAAAAABQAAA= - Game\Items\Containers\LootContainer.cs - - - - - - AAAIAAAAAAAAAAAEwACAAgCAAAACAIAAAAAAAAAABQE= - Game\Items\Currency.cs - - - - - - - AAAAAAAAAAAAAgAAAAIAAAQAAAAAAAAAAAAAiAAAAgI= - Game\Items\Item.cs - - - - - - - AgAAgAAAAACAAAAEAAAAQQCAAAAAAAAABAAAAEAAAAg= - Game\Items\Equipment\Weapons\Weapon.cs - - - - - - - - - - AAAACAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA= - Game\Items\Gems\Gem.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Items\Gems\GemRuby.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Items\Magical\Scroll.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Items\Magical\Tome.cs - - - - - - AAAAAAAAAAIAAAAEAACgAAAAAAAAAAAAAAAAAAGAAAA= - Game\Items\Potions\Potion.cs - - - - - - - - - - - - Game\GameEngine.cs - - - - - Game\GameEngine.cs - - - - - AgRAgAAAACAAAQAAIAARAAAAgIAACAQABIEAAwkAAxI= - Game\GameEngine.cs - - - - - - - - - - ABAABAAAAAAAAwEAAIIAAAQAACAAAACACAEAigAAgAA= - Game\Actor.cs - - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAA= - Game\Dice.cs - - - - - - - - Game\Dungeon.cs - - - - - AAAAAAAABAEAAAAAgQAAAEAAAAAMAAAAgBAAAAIAAAA= - Game\Dungeon.cs - - - - - - AAAAAAAAAAAAAAIEQACAAiAAAAAAAAAAAAAABAAAByA= - Game\Location.cs - - - - - - AAAAAACAAAAAAAQEQACAAiAAAAAAAAAAAAAAAAAAZQA= - Game\Location.cs - - - - - - - - Game\Speech.cs - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAA= - Game\Speech.cs - - - - - - AgAACAAAAAEAACAAAAAEBAAAAAAAAAAAAAAAIAAAQAA= - Game\Stats.cs - - - - - - AAAIAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAA= - Game\Affects\AffectResistance.cs - - - - - - - - Game\Affects\Affects.cs - - - - - Game\Affects\Affects.cs - - - - - AAAIBAAAAAACAAAEAAAAAAAAAAAAAAAAAAAAICEAQAA= - Game\Affects\Affects.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Events\GameEventArgs.cs - - - - - - AAAAAAAAABAAAAAAAAAAAAAAAAAEAAAAAAAAIAAAAAA= - Game\Items\Equipment\Tools\Tool.cs - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAA= - Game\Events\ActorEventArgs.cs - - - - - - AAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Actions\Attack.cs - - - - - - AAAAAAEAAAAAAgAAAAAAAAAgAAAAAAgAAAAAAAAAAAA= - Game\Actions\Attack.cs - - - - - - EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Actions\Attack.cs - - - - - - AAAAAIAAAACAAAAACAAABgAAAAAgAAAAEAAAAAAAAAA= - Game\Items\Equipment\Weapons\WeaponProperties.cs - - - - - - AAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAEAAAAAAA= - Game\Colour.cs - - - - - - ACAKACRBiAACAAAM4BAAAFAABIACAAgIABAMADACgAA= - Game\Colour.cs - - - - - - - AAIAAAEAAACAQIAEEAAAAAAAAAAAAAAAQAAAAAAEAAA= - Game\Items\Equipment\Armor\ArmorLocation.cs - - - - - - AAAAAAAAAAAAAIAAAQAAAAgAAAEAAAAAAAAgAAAAABA= - Game\Items\Equipment\Armor\ArmorType.cs - - - - - - AAAIAAIAAAAAAgAAAAAAAAAAAAAAAIAAEAAgAAAgAAE= - Game\Items\Equipment\Material.cs - - - - - - AAAAAAAAAAAAAACAAAAAAAAAAEAEAAAAAAAAAAAAAAA= - Game\Items\Equipment\Quality.cs - - - - - - AAhEwAABgCABBIEAABAAAAECAIIIAEEAgAAAQSKIAAE= - Game\Items\Equipment\Weapons\WeaponType.cs - - - - - - AAAAAAASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAA= - Game\Items\Potions\PotionType.cs - - - - \ No newline at end of file diff --git a/src/DotNetHack/UML/Interfaces.cd b/src/DotNetHack/UML/Interfaces.cd deleted file mode 100644 index d62ed39..0000000 --- a/src/DotNetHack/UML/Interfaces.cd +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - AAAAAAAAAAAAAAIEQACAAiAAAAAAAAAAAAAABAAAByA= - Game\Location.cs - - - - - - ACAKACRBiAACAAAM4BAAAFAABIACAAgIABAMADACgAA= - Game\Colour.cs - - - - - - - AAAAAACAAAAAAAQEQACAAiAAAAAAAAAAAAAAAAAAZQA= - Game\Location.cs - - - - - - AgAAAAAAAAAAAAAAAAAAAACAAAAAAAAABAAAAEAAAAg= - Game\Interfaces\IWeapon.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IConsumable.cs - - - - - - AAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IDrawable.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IDrawable.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IEquipment.cs - - - - - - IAAAAAAIEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IFood.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiAAAAAA= - Game\Interfaces\IGlyph.cs - - - - - - - - - AAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IHasCharges.cs - - - - - - AAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IHasCondition.cs - - - - - - AAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IHasLocation.cs - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAA= - Game\Interfaces\IHasUses.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAgA= - Game\Interfaces\IItem.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IMagical.cs - - - - - - AAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAA= - Game\Interfaces\IPotion.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IReadable.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IScroll.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\ITome.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IWand.cs - - - - - - BAAAAAAAAAEQAAAAAAAECAAAAAAAAAAAAAAAAAAAAAA= - Game\Interfaces\IArmor.cs - - - - - - AAAAAAAAABAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= - Game\Interfaces\ITool.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAA= - Game\Interfaces\IWearable.cs - - - - \ No newline at end of file diff --git a/src/DotNetHack/UML/UserInterface.cd b/src/DotNetHack/UML/UserInterface.cd deleted file mode 100644 index da7d109..0000000 --- a/src/DotNetHack/UML/UserInterface.cd +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - UI\Display.cs - - - - - UI\Display.cs - - - - - AAAAAAAAAEAAJwAAAAAAAAAEAABAAAAAAAAAAARAAAA= - UI\Display.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - UI\DisplayRegion.cs - - - - - - - - - - - UI\Menu.cs - - - - - UI\Menu.cs - - - - - AAABAAAAAIAAAEAAAAAAAAAAAAQEABAAAECAgAAAAAA= - UI\Menu.cs - - - - - - GECFDwCMoxKgAtIYIEgeCEAEEMlCAAEBIAIAxFqhACE= - UI\Symbols.cs - - - - - - AAAAggAAAAACAAAAAAAAAAAAAAAEAAAAAgBAAAAAAQQ= - UI\Window.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAACAA= - UI\Windows\WindowCharacterSheet.cs - - - - - - QAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAA= - UI\Windows\WindowInventory.cs - - - - - - AAQAAAAABABAEAAAEAEAAEAABAAEAAABAAAAAAEEYAA= - UI\Widget.cs - - - - - - - - - ACACAAAAAEAQAAIAAAAAAAAAAAAEAAAACAIgCAAAAAA= - UI\ProgressBar.cs - - - - - - AAAAAAAAAAAAAAAAAAAAAUBAAACAAAAAAAAAAAAAAAA= - Utility\Rectangle.cs - - - - \ No newline at end of file diff --git a/src/DotNetHack/Utility/DataLoader.cs b/src/DotNetHack/Utility/DataLoader.cs deleted file mode 100644 index 735caac..0000000 --- a/src/DotNetHack/Utility/DataLoader.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Items.Equipment.Weapons; -using System.IO; - -namespace DotNetHack.Utility -{ - /// - /// DatLoader - /// - public class DataLoader - { - /// - /// Creates a new instance of DatLoader - /// The path where data files are stored. - /// - public DataLoader(string aDataPath) - { - DataPath = aDatPath; - } - - /// - /// LoadWeapons - /// - /// - public Weapon[] LoadWeapons() - { - const string WEAPON_XML = "weapons.xml"; - string weaponDataFullPath = Path.Combine(DataPath, WEAPON_XML); - if (!File.Exists(weaponDataFullPath)) - throw new ApplicationException(); - } - - /// - /// DatPath - /// - public string DataPath { get; set; } - } -} diff --git a/src/DotNetHack/Utility/Graph/Algorithm/AStar.cs b/src/DotNetHack/Utility/Graph/Algorithm/AStar.cs deleted file mode 100644 index d35577b..0000000 --- a/src/DotNetHack/Utility/Graph/Algorithm/AStar.cs +++ /dev/null @@ -1,360 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Dungeon.Tiles; -using DotNetHack.Game.Dungeon; -using DotNetHack.Game.Interfaces; -using DotNetHack.Game; - -namespace DotNetHack.Utility.Graph.Algorithm -{ - /// - /// Extension methods for rectangle, specific to this A* implementation. - /// - public static class RectangleExt - { - /// - /// Manhattan method, where you calculate the total number of squares moved - /// horizontally and vertically to reach the target square from the current - /// square, ignoring diagonal movement, and ignoring any obstacles that may - /// be in the way. - /// - /// the following rectangle has a manhattan distance of 14. - /// - /// x - /// x - /// x - /// x - /// x - /// x y y y y y y y y - /// - /// - /// - /// - /// - public static int ManhattanDistance(this Rectangle r) { return r.Width + r.Length; } - } - - /// - /// DungeonPathFinding - /// The following pages were and still are quite informative: - /// http://en.wikipedia.org/wiki/A*_search_algorithm - /// http://www.policyalmanac.org/games/aStarTutorial.htm - /// - /// TODO: Significant amount of tuning still required for this A* implementation. - /// - F, G, and H performance numbers all require additional work. - /// - General tuning, right now one monster is dog slow. - /// 7/26/2011 - Initial working copy. - /// - [Serializable] - public class DungeonPathFinding - { - /// - /// DungeonPathFinding - /// - /// The dungeon - /// Start location - /// End location - public DungeonPathFinding(Dungeon3 d) - { - // Set the dungeon, the start node and the end node. - Dungeon = d; - - // Setup G, client code may overwrite this functionality. - GFunc = delegate(Node a, Node b) - { - return new Rectangle(a.Location, b.Location).ManhattanDistance() * 10; - }; - - // Setup G, client code may overrite this functionality. - HFunc = delegate(Node a, Node b) { return (int)(a.Distance(b) * 100); }; - } - - /// - /// The initialization step. - /// - void Initialize(Location3i aAlpha, Location3i aOmega) - { - StartNode = new Node(Dungeon.GetTile(aAlpha), aAlpha); - EndNode = new Node(Dungeon.GetTile(aOmega), aOmega); - - // Initialize FCost dictionary. - FCostDict = new Dictionary(); - - // create the closed list and the open list. - OpenList = new List(); - ClosedList = new List(); - - OpenList.Add(StartNode); - - // find all closed tiles - PopulateClosedList(); - - // Index through viable neighbors, add it to open list. - foreach (var t in GetNeighbors(StartNode)) - OpenList.Add(t); - - /// Drop the starting square A from your open list, and add it - /// to a “closed list” of squares that you don’t need to look at again for now. - OpenList.Remove(StartNode); - } - - /// - /// UnwindPath, holy smoke. - /// - /// - public void UnwindPath(Node aNode, Stack aResult) - { - aResult.Push(aNode); - if (aNode.Parent != null) - UnwindPath(aNode.Parent, aResult); - } - /// - /// http://en.wikipedia.org/wiki/A*_search_algorithm - /// - /// - /// - public Stack Solve(IHasLocation aAlpha, IHasLocation aOmega) - { - // infinityly close for path finding. - if (aAlpha.Location == aOmega.Location) - return null; - - // TODO: Beside this, determine what happens when different floors. - if (aAlpha.Location.D != aOmega.Location.D) - return null; - - Initialize(aAlpha.Location, aOmega.Location); - - Node n, last = null; - while (OpenList.Count > 0) - { - OpenList.Sort(Cmp); - n = OpenList[0]; - - if (n.Location == EndNode.Location) - { - last = n; - break; - } - - OpenList.Remove(n); - ClosedList.Add(n); - -#if A_STAR_VIS - /// - /// WARNING: for visualization only. - /// - - foreach (var k in OpenList) - Dungeon.GetTile(k.Location).C = Colour.Green; - - foreach (var k in ClosedList) - Dungeon.GetTile(k.Location).C = Colour.Road; - - Dungeon.DungeonRenderer.Render(n.Location); -#endif - - foreach (var y in GetNeighbors(n)) - { - if (ClosedList.Contains(y)) - continue; - if (!OpenList.Contains(y)) - OpenList.Add(y); - y.Parent = n; - } - } - - if (last != null) - if (last.Parent != null) - { - // no sense in being celverm this'll get it done - Stack retVal = new Stack(); - UnwindPath(last, retVal); - - retVal.Reverse(); - retVal.Pop(); - - return retVal; - } - return null; - } - - /// - /// To keep from re-computing FCost a dictionary is used to short cirtcuit - /// results that may have already been calculated. - /// - Dictionary FCostDict { get; set; } - - /// - /// Computes the FCost of the given node. - /// - /// The start location. - /// The node - /// The end location. - /// An integer representing the computed FCost - public int Compute(Node start, Node n, Node end) - { - var fCost = new FCost(GFunc(start, n), HFunc(n, end)); - if (!FCostDict.ContainsKey(n)) - FCostDict.Add(n, fCost); - return FCostDict[n].F; - } - - /// - /// Compares two nodes' FCost and returns equivalency integer - /// - /// LHS node - /// RHS node - /// equivalency integer - public int Cmp(Node a, Node b) - { - return Compute(StartNode, a, EndNode) - - Compute(StartNode, b, EndNode); - } - - /// - /// One method used used to compute H and G's - /// - /// - /// - double ManhattanDistance(Node from, Node to) - { - return new Rectangle(from.Location, to.Location).ManhattanDistance(); - } - - /// - /// Find all closed tiles. Should be done right off the bat. - /// - public void PopulateClosedList() - { - // find all impassable tiles, add them to the closed list. - Dungeon.IterateDungeonData(delegate(int x, int y, int d) - { - // note: IsPassable takes into account monsters. - ITile examineTile = Dungeon.GetTile(x, y, d); - if (!Dungeon.IsPassable(new Location3i(x, y, d))) - ClosedList.Add(new Node(examineTile, - new Game.Location3i(x, y, d))); - }); - } - - /// - /// GetNeighbors - /// - /// The current node. - /// - public IEnumerable GetNeighbors(Node aNode) - { - // List enumeration for neighboring nodes - List tmpList = new List(); - - // This nodes location (used repeatedly) - Location3i l = aNode.Location; - - // The dungeon level were working on. - int d = l.D; - - /// Repeat for all n sides. - /// - /// 1. get ortho location. - /// 1.1. check bounds for location - /// 1.1.1. Add node to short list. - - Location3i lLeft = Location3i.GetNew(l.X - 1, l.Y, d); - if (Dungeon.CheckBounds(lLeft)) - tmpList.Add(new Node(Dungeon.GetTile(lLeft, l.D), lLeft)); - - Location3i lRight = Location3i.GetNew(l.X + 1, l.Y, d); - if (Dungeon.CheckBounds(lRight)) - tmpList.Add(new Node(Dungeon.GetTile(lRight, l.D), lRight)); - - Location3i lDown = Location3i.GetNew(l.X, l.Y + 1, d); - if (Dungeon.CheckBounds(lDown)) - tmpList.Add(new Node(Dungeon.GetTile(lDown, l.D), lDown)); - - Location3i lUp = Location3i.GetNew(l.X, l.Y - 1, d); - if (Dungeon.CheckBounds(lUp)) - tmpList.Add(new Node(Dungeon.GetTile(lUp, l.D), lUp)); - - // return an IEnumerable based on some predicate. - return tmpList.Where(t => !t.Impassable); - } - - /// - /// Dungeon - /// - Dungeon3 Dungeon { get; set; } - - /// - /// The starting node. - /// - public Node StartNode { get; set; } - - /// - /// the ending terminal node - /// - Node EndNode { get; set; } - - /// - /// The open list. - /// - List OpenList { get; set; } - - /// - /// This is the closed, list, these can be ignored. - /// - List ClosedList { get; set; } - - /// - /// Computing G - /// - public Func GFunc { get; set; } - - /// - /// Computing H - /// - public Func HFunc { get; set; } - } - - /// - /// The key to determining which squares to use when figuring out - /// the path is the following equation: - /// F = G + H - /// - class FCost : IComparable - { - /// - /// Creates a new instance of f cost. - /// - /// - /// - public FCost(int g, int h) { H = h; G = g; } - - /// - /// the movement cost to move from the starting point A to a given square - /// on the grid, following the path generated to get there. - /// - public int G { get; set; } - - /// - /// the estimated movement cost to move from that given square on - /// the grid to the final destination, point B. This is often referred - /// to as the heuristic, which can be a bit confusing. - /// - public int H { get; set; } - - /// - /// F is calculated by adding G and H. - /// - public int F { get { return G + H; } } - - /// - /// CompareTo - /// - /// The other FCost being compared. - /// comparison result. - public int CompareTo(FCost other) { return F.CompareTo(other.F); } - } -} diff --git a/src/DotNetHack/Utility/Graph/Algorithm/IAStar.cs b/src/DotNetHack/Utility/Graph/Algorithm/IAStar.cs deleted file mode 100644 index f467792..0000000 --- a/src/DotNetHack/Utility/Graph/Algorithm/IAStar.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -namespace DotNetHack.Utility.Graph.Algorithm -{ - interface IAStar - { - System.Collections.Generic.IEnumerable GetNeighbors(T aNode); - Func Heuristic { get; set; } - void Initialize(); - void PopulateClosedList(); - } -} diff --git a/src/DotNetHack/Utility/Graph/Algorithm/Node.cs b/src/DotNetHack/Utility/Graph/Algorithm/Node.cs deleted file mode 100644 index daf7494..0000000 --- a/src/DotNetHack/Utility/Graph/Algorithm/Node.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game.Dungeon.Tiles; -using DotNetHack.Game; -using DotNetHack.Game.Interfaces; - -using System.Diagnostics; - -namespace DotNetHack.Utility.Graph -{ - /// - /// The basic node used for all DNH graph calculations. - /// - [DebuggerDisplay("{ToString()}"), Serializable] - public class Node : IHasLocation, IEquatable - { - /// - /// Creates a new DNH tile Node - /// The tile info and location are normally decoupled but are - /// brought together in this instance. - /// - /// The tile information associated with this node - /// The location of this node. - /// The parent node - public Node(ITile aTile, Location3i aLocation, Node Parent = null) - { - Parent = null; - TileInfo = aTile; - Location = aLocation; - } - - /// - /// Stores information about the tile. - /// - public ITile TileInfo { get; set; } - - /// - /// Location - /// - public Location3i Location { get; set; } - - /// - /// Parent - /// - public Node Parent { get; set; } - - /// - /// Determines if the A* node is impassable. - /// - public bool Impassable - { - get { return TileInfo.Impassable; } - } - - public bool Equals(Node other) { return this.Location == other.Location; } - - /// - /// How a node is displayed as text. - /// (0,0,0) => (null) - /// (9,9,9) => (10, 10, 10) - /// - /// Returns a string representation of this node. - public override string ToString() - { - string strThisNode, strParentNode; - strThisNode = "(null)"; strParentNode = strThisNode; - strThisNode = Location.ToString(); - if (Parent != null) - if (Parent.Location != null) - strParentNode = Parent.Location.ToString(); - return string.Format("Node:{0} => {1}", strThisNode, strParentNode); - } - - } -} diff --git a/src/DotNetHack/Utility/LockFile.cs b/src/DotNetHack/Utility/LockFile.cs deleted file mode 100644 index 8e3b7ed..0000000 --- a/src/DotNetHack/Utility/LockFile.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.IO; - -namespace DotNetHack.Utility -{ - /// - /// LockFile object - /// - public class LockFile : IDisposable - { - /// - /// LockFile - /// The option of using FileOptions.DeleteOnClose was scrapped because - /// a FileStream would have to be maintained. Since we dont actually write to a lock file - /// We've opted to skip the stream and therefore DeleteOnClose. - /// - /// - /// aLockPath - public LockFile(string aLockPath, bool aLock = true) - { - // Immediately set the lock file path, as the combination of the path - // combined with the the actual lock file extension. - LockFilePath = Path.Combine(aLockPath, LOCK_FILE); - - // GetLock - if (aLock == true) - GetLock(); - } - - /// - /// Create a LockFile. Just creating the lock file does not *create* the lock file itself - /// until the call to GetLock() is made. - /// - /// - public LockFile(string aLockPath) - : this(aLockPath, false) - { } - - /// - /// Get a lock on the path that this LockFile was created with. - /// If the file is not locked (.lock does not exist) then - /// create a .lock file. - /// catch (DirectoryNotFoundException) { } is not required since supertype - /// (IOException) is already caught. All other exceptions are not caught *intentionally*. - /// - /// - public bool GetLock() - { - if (!IsLocked) - try { File.Create(LockFilePath); } - catch (IOException) { } - catch (Exception ex) { throw new LockFileException("Unable to create lock file.", ex); } - return IsLocked; - } - - /// - /// Remove the lock on the path that this LockFile was created with. - /// - /// If the .lock file is present remove it. - /// catch (DirectoryNotFoundException) { } is not required since supertype - /// (IOException) is already caught. All other exceptions are not caught *intentionally*. - /// - /// - public bool RemoveLock() - { - if (IsLocked) - try { File.Delete(LockFilePath); } - catch (IOException) { } - catch (Exception ex) { throw new LockFileException("Unable to remove lock file.", ex); } - return !IsLocked; - } - - /// - /// Is this file path locked with a lock file? - /// - /// true - if lock exists - public bool IsLocked - { - get { return File.Exists(LockFilePath); } - } - - /// - /// Disposes of this such that a lock wont be accidentally - /// persisted across several instances a the program. - /// - public void Dispose() { RemoveLock(); } - - /// - /// The lock file path as represented by this lock file. - /// - private string LockFilePath { get; set; } - - /// - /// The lock file is a file named ".lock". - /// - const string LOCK_FILE = ".lock"; - - /// - /// LockException - /// - public class LockFileException : Exception - { - /// - /// Creates a new LockFileException - /// - public LockFileException() { } - - /// - /// Creates a new LockFileException - /// - /// The message that describes the error. - public LockFileException(string message) - : base(message) { } - - /// - /// Creates a new LockFileException - /// - /// The message that describes the error - /// The inner exception of the error, the cause. - public LockFileException(string message, Exception innerException) - : base(message, innerException) { } - } - } -} diff --git a/src/DotNetHack/Utility/Media/BaseSoundController.cs b/src/DotNetHack/Utility/Media/BaseSoundController.cs deleted file mode 100644 index a33be40..0000000 --- a/src/DotNetHack/Utility/Media/BaseSoundController.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; - -namespace DotNetHack.Utility.Media -{ - /// - /// BaseSoundController - /// - public abstract class BaseSoundController - { - - /// - /// Initialize - /// - public virtual void Initialize() - { - if (OnSoundControllerInit != null) - OnSoundControllerInit(this, new EventArgs()); - } - - /// - /// Play - /// - public virtual void PlaySound(string aSoundFileName) - { - if (OnSoundPlayback != null) - OnSoundPlayback(this, new EventArgs()); - } - - /// - /// - /// - public virtual void Stop() - { - - } - - /// - /// OnSoundPlayback - /// - protected event EventHandler OnSoundPlayback; - - /// - /// Occurs when the sound controller is initialized. - /// - protected event EventHandler OnSoundControllerInit; - - /// - /// OnSoundControllerInitFail - /// - protected event ErrorEventHandler OnSoundControllerInitFail; - } -} diff --git a/src/DotNetHack/Utility/Media/SoundController.cs b/src/DotNetHack/Utility/Media/SoundController.cs deleted file mode 100644 index afc44ad..0000000 --- a/src/DotNetHack/Utility/Media/SoundController.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace DotNetHack.Utility.Media -{ - /// - /// SoundController - /// Manages the interleaved playback of sounds for DotNetHack. - /// - /// - /// Depends upon NAudio - /// - public partial class SoundController : BaseSoundController - { - - #region constructor - - /// - /// Creates a new instance of sound conroller. - /// private to disallow creation outside of singleton-pattern specs. - /// - SoundController() { } - - #endregion - - #region public facing properties - - /// - /// The accessor for the singleton SoundController. - /// Interface with this object through here. - /// - public static SoundController Instance - { - get - { - if (_instance == null) - lock (_syncRoot) - _instance = new SoundController(); - return _instance; - } - } - - #endregion - - #region static fields - - /// - /// the singleton'ed instance - /// - private static volatile SoundController _instance; - - /// - /// Aides in supporting multi-threaded access. - /// - private static object _syncRoot = new Object(); - - #endregion - } -} diff --git a/src/DotNetHack/Utility/Media/SoundControllerCore.cs b/src/DotNetHack/Utility/Media/SoundControllerCore.cs deleted file mode 100644 index ad6fbda..0000000 --- a/src/DotNetHack/Utility/Media/SoundControllerCore.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using NAudio.Wave; -using System.Collections.Generic; -using System.Threading; -using System.IO; -using System.Media; -using DotNetHack.Game; - -namespace DotNetHack.Utility.Media -{ - /// - /// SoundController, core - /// partial - /// - /// - public partial class SoundController : BaseSoundController - { - /// - /// Initialize - /// - public override void Initialize() - { - try - { - SoundDisabled = false; - - // Call down to base to fire up events. - base.Initialize(); - - // Setup mixer - - Mixer = new WaveMixerStream32(); - Mixer.AutoStop = false; - - // Create a new wave-out device. - WaveOutDevice = new WaveOut(WaveCallbackInfo.FunctionCallback()); - WaveOutDevice.Init(Mixer); - WaveOutDevice.Play(); - - // Initialize the lazy loading hash - SoundCache = new Dictionary(); - } - catch (Exception sound_ex) { SoundDisabled = true; } - } - - /// - /// PlaySound - /// - /// do not pass a fully qualified path, just a filename - /// - /// The name of the sound file to play. - public override void PlaySound(string aSoundFileName) - { - if (SoundDisabled) - return; - - aSoundFileName = Path.Combine( - R.DatSoundsDirectory, aSoundFileName); - - if (!File.Exists(aSoundFileName)) - return; - - if (!SoundCache.ContainsKey(aSoundFileName)) - { - WaveFileReader tmpWaveFileReader = new WaveFileReader(aSoundFileName); - WaveOffsetStream tmpWaveOffsetStream = new WaveOffsetStream(tmpWaveFileReader); - WaveChannel32 tmpWaveChannel32 = new WaveChannel32(tmpWaveFileReader); - - SoundCache.Add(aSoundFileName, new CoreSample() - { - WaveFileReader = tmpWaveFileReader, - WaveOffsetStream = tmpWaveOffsetStream, - WaveChannel32 = tmpWaveChannel32, - }); - - Mixer.AddInputStream(SoundCache[aSoundFileName].WaveChannel32); - } - - try { SoundCache[aSoundFileName].WaveChannel32.Position = 0x00; } - catch { } - } - - public override void Stop() - { - base.Stop(); - - WaveOutDevice.Stop(); - WaveOutDevice.Dispose(); - WaveOutDevice = null; - } - - /// - /// WaveOutDevice, interface(ed) - /// - IWavePlayer WaveOutDevice = null; - - /// - /// The Mixer - /// - WaveMixerStream32 Mixer = null; - - /// - /// LazyCoreShot - /// - Dictionary SoundCache { get; set; } - - /// - /// SoundDisabled - /// - bool SoundDisabled { get; set; } - - /// - /// Aggregated objects required for playback - /// - struct CoreSample - { - public WaveFileReader WaveFileReader; - public WaveChannel32 WaveChannel32; - public WaveOffsetStream WaveOffsetStream; - } - } -} diff --git a/src/DotNetHack/Utility/Media/SoundControllerEvents.cs b/src/DotNetHack/Utility/Media/SoundControllerEvents.cs deleted file mode 100644 index 1be33c4..0000000 --- a/src/DotNetHack/Utility/Media/SoundControllerEvents.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; - -namespace DotNetHack.Utility.Media -{ - /// - /// SoundControllerEvents, - /// partial. - /// - public partial class SoundController : BaseSoundController - { - - - } -} diff --git a/src/DotNetHack/Utility/Persisted/Persisted.cs b/src/DotNetHack/Utility/Persisted/Persisted.cs deleted file mode 100644 index b6865df..0000000 --- a/src/DotNetHack/Utility/Persisted/Persisted.cs +++ /dev/null @@ -1,112 +0,0 @@ - -/// Extends Object for quick, generic programmed, serialization. -/// Copyright (C) 2011 Peter Jensen -/// -/// This program is free software: you can redistribute it and/or modify -/// it under the terms of the GNU General Public License as published by -/// the Free Software Foundation, either version 3 of the License, or -/// (at your option) any later version. -/// -/// This program is distributed in the hope that it will be useful, -/// but WITHOUT ANY WARRANTY; without even the implied warranty of -/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/// GNU General Public License for more details. -/// -/// You should have received a copy of the GNU General Public License -/// along with this program. If not, see . - -using System; -using System.IO; - -namespace System.Xml.Serialization.Persisted -{ - /// - /// Extension method that rides on top of all obects. - /// - public static class Persisted - { - #region Various supported interfaces may reside here. - - /// - /// For complex objects that have implement IPersisted they can use - /// Read directly without having to drop down to the string level. - /// - public partial interface IPersisted - { - /// - /// The location that this disk-file that this IPersisted(T) resides in. - /// - string FileName { get; set; } - } - - #endregion - - /// - /// Read a templated type from a fully qualified file-path; return the deserialized object. - /// - /// The templated type that willl be returned. - /// The fully qualified file path that will be deserialized. - /// The result of deserialize, casted as T - /// {strFullPath} not found - public static T Read(this string strFullPath) - { - if (!File.Exists(strFullPath)) - throw new IOException(string.Format("{0} not found", strFullPath)); - using (Stream fs = new FileStream(strFullPath, FileMode.Open)) - { - XmlSerializer serializer = new XmlSerializer(typeof(T)); - return (T)serializer.Deserialize(fs); - } - } - - /// - /// Read a templated generic type from the passed . - /// - /// The templated type being persisted. - /// The actual object being peristed. - /// - public static T Read(this IPersisted aPersisted) - { - return aPersisted.FileName.Read(); - } - - /// - /// Write the templated type (aObj) to the fully qualified file-path. - /// If the path does not exist, the full-directory-tree will be created. - /// - /// The templated type that willl be written to disk. - /// The actual object that is written to disk. - /// The fully qualified file-path. - /// c:\temp\out\1.xml - /// .\out\2.xml - /// 3.xml - /// - /// true when the operation was a success. - public static bool Write(this T aObj, string strFullPath) - { - try - { - string strDirectory = Path.GetDirectoryName(strFullPath); - if (!Directory.Exists(strDirectory) && !string.Empty.Equals(strDirectory)) - Directory.CreateDirectory(strDirectory); - using (FileStream tmpRawStream = File.Open(strFullPath, FileMode.OpenOrCreate)) - using (XmlTextWriter tmpXmlWriter = new XmlTextWriter(tmpRawStream, new System.Text.UTF8Encoding())) - new XmlSerializer(aObj.GetType()).Serialize(tmpXmlWriter, aObj); - return true; - } - catch { return false; } - } - - /// - /// Writes the IPersisted object to the location defined in the interface. - /// - /// - /// The templated type param - /// The actual object that is written to disk. - /// true when the operation was a success. - public static bool Write(this IPersisted aObj) - { - return aObj.Write(aObj.FileName); - } - } -} diff --git a/src/DotNetHack/Utility/Rectangle.cs b/src/DotNetHack/Utility/Rectangle.cs deleted file mode 100644 index 07def51..0000000 --- a/src/DotNetHack/Utility/Rectangle.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DotNetHack.Game; - -namespace DotNetHack.Utility -{ - /// - /// BufferedRegion - /// - public class Rectangle - { - /// - /// Creates a new buffered region. - /// - /// The first point used for form the region - /// The second point used to for the region. - public Rectangle(Location2i a, Location2i b) { P1 = a; P2 = b; } - - /// - /// Creates a new buffered region. - /// - /// x-coord of the first point used to form the region - /// y-coord of the first point used to form the region - /// x-coord of the second point used to form the region - /// y-coord of the second point used to form the region - public Rectangle(int x1, int y1, int x2, int y2) - : this(new Location2i(x1, y1), new Location2i(x2, y2)) - { } - - /// - /// The length of the rectangle - /// - public int Length { get { return Math.Abs(P1.Y - P2.Y); } } - - /// - /// The width of the rectangle. - /// - public int Width { get { return Math.Abs(P1.X - P2.X); } } - - /// - /// The first point of the buffered region. - /// - public Location2i P1 { get; set; } - - /// - /// The second point of the buffered region. - /// - public Location2i P2 { get; set; } - } -} diff --git a/src/DotNetHack/Utility/Reg.cs b/src/DotNetHack/Utility/Reg.cs deleted file mode 100644 index ac262e0..0000000 --- a/src/DotNetHack/Utility/Reg.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using Microsoft.Win32; -using System.Security; - -namespace DotNetHack.Utility -{ - /// - /// Reg - /// - public class Reg - { - /* - public static bool SyncEnabled - { - // Definsively init things like this in the negative = ) - get { return Convert.ToBoolean(SoftwareKey.GetValue("SyncEnabled", false)); } - set { SoftwareKey.SetValue("SyncEnabled", value); } - }*/ - - /// - /// Reg - /// - public Reg(string aRegistryHome) - { - try - { - UserKey = Registry.CurrentUser; - SoftwareKey = UserKey.CreateSubKey(aRegistryHome, - RegistryKeyPermissionCheck.ReadWriteSubTree); - } - catch (Exception ex) { throw new DNHackException("Registry exception", ex); } - } - - #region Instance Fields - - /// - /// UserKey - /// - public RegistryKey UserKey; - - /// - /// SoftwareKey - /// - public RegistryKey SoftwareKey; - - #endregion - } -} diff --git a/src/DotNetHack/Utility/Util.cs b/src/DotNetHack/Utility/Util.cs deleted file mode 100644 index fce59f0..0000000 --- a/src/DotNetHack/Utility/Util.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Runtime.Serialization.Formatters.Binary; -using System.IO; - -namespace DotNetHack.Utility -{ - /// - /// Utility Classes and Methods - /// - public static class Util - { - /// - /// Compute a as a percentage in relation to b. - /// (a/b)*100 - /// - /// a - /// b - /// the percentage - public static double Percent(int a, int b) - { - return (a / (b * 1.0)) * 100.00; - } - - /// - /// Sigmoid, squashes input to [0,1] - /// http://en.wikipedia.org/wiki/Sigmoid_function - /// return 2 / (1 + System.Math.Exp(-2 * n)) - 1; - /// - /// the input x, for f(x) - /// - public static double Sigmoid(double n) - { - return 1 / (1 + System.Math.Exp(-n)); - } - - - /// - /// - /// - /// The type to deep copy - /// The objec to deep copy - /// The deep copied result. - public static T DeepCopy(T obj) - { - object result = null; - - using (var ms = new MemoryStream()) - { - var formatter = new BinaryFormatter(); - formatter.Serialize(ms, obj); - ms.Position = 0; - - result = (T)formatter.Deserialize(ms); - ms.Close(); - } - - return (T)result; - } - } -} diff --git a/src/DotNetHack/bin/Debug/DotNetHack.Core.dll b/src/DotNetHack/bin/Debug/DotNetHack.Core.dll new file mode 100755 index 0000000..c043481 Binary files /dev/null and b/src/DotNetHack/bin/Debug/DotNetHack.Core.dll differ diff --git a/src/DotNetHack/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/DotNetHack/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..8f3a7f7 Binary files /dev/null and b/src/DotNetHack/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/DotNetHack/obj/Debug/DotNetHack.csproj.FileListAbsolute.txt b/src/DotNetHack/obj/Debug/DotNetHack.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..774f806 --- /dev/null +++ b/src/DotNetHack/obj/Debug/DotNetHack.csproj.FileListAbsolute.txt @@ -0,0 +1,16 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\obj\Debug\DotNetHack.csprojResolveAssemblyReference.cache +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.exe.config +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.exe +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.AI.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.Core.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.GameEngine.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.Plugin.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.Serialization.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.AI.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.Core.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.GameEngine.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.Serialization.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\bin\Debug\DotNetHack.Plugin.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\obj\Debug\DotNetHack.exe +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\DotNetHack\obj\Debug\DotNetHack.pdb diff --git a/src/DotNetHack/obj/Debug/DotNetHack.csprojResolveAssemblyReference.cache b/src/DotNetHack/obj/Debug/DotNetHack.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..89f7a80 Binary files /dev/null and b/src/DotNetHack/obj/Debug/DotNetHack.csprojResolveAssemblyReference.cache differ diff --git a/src/DotNetHack/obj/Debug/DotNetHack.exe b/src/DotNetHack/obj/Debug/DotNetHack.exe new file mode 100644 index 0000000..4b2a13b Binary files /dev/null and b/src/DotNetHack/obj/Debug/DotNetHack.exe differ diff --git a/src/DotNetHack/obj/Debug/DotNetHack.pdb b/src/DotNetHack/obj/Debug/DotNetHack.pdb new file mode 100644 index 0000000..680753d Binary files /dev/null and b/src/DotNetHack/obj/Debug/DotNetHack.pdb differ diff --git a/xml/spells/none.xml b/src/DotNetHack/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from xml/spells/none.xml rename to src/DotNetHack/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/xml/spells/physical.xml b/src/DotNetHack/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs similarity index 100% rename from xml/spells/physical.xml rename to src/DotNetHack/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs diff --git a/xml/spells/poison.xml b/src/DotNetHack/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs similarity index 100% rename from xml/spells/poison.xml rename to src/DotNetHack/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs diff --git a/src/Plugins/DotNetHack.Plugin/AssemblyInfo.cs b/src/Plugins/DotNetHack.Plugin/AssemblyInfo.cs new file mode 100644 index 0000000..ff83447 --- /dev/null +++ b/src/Plugins/DotNetHack.Plugin/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DotNetHack.Plugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("pjensen")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/Plugins/DotNetHack.Plugin/DotNetHack.Plugin.csproj b/src/Plugins/DotNetHack.Plugin/DotNetHack.Plugin.csproj new file mode 100644 index 0000000..959b294 --- /dev/null +++ b/src/Plugins/DotNetHack.Plugin/DotNetHack.Plugin.csproj @@ -0,0 +1,74 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {EA25AAA4-507F-4CFA-AB6D-ABC7F59D941A} + Library + DotNetHack.Plugin + DotNetHack.Plugin + v4.5 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + false + + + none + true + bin\Release + prompt + 4 + false + false + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + + \ No newline at end of file diff --git a/src/Plugins/DotNetHack.Plugin/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/Plugins/DotNetHack.Plugin/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..3e851fb Binary files /dev/null and b/src/Plugins/DotNetHack.Plugin/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.csproj.FileListAbsolute.txt b/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..57033d5 --- /dev/null +++ b/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.csproj.FileListAbsolute.txt @@ -0,0 +1,4 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Plugins\DotNetHack.Plugin\bin\Debug\DotNetHack.Plugin.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Plugins\DotNetHack.Plugin\bin\Debug\DotNetHack.Plugin.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Plugins\DotNetHack.Plugin\obj\Debug\DotNetHack.Plugin.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Plugins\DotNetHack.Plugin\obj\Debug\DotNetHack.Plugin.pdb diff --git a/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.dll b/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.dll new file mode 100644 index 0000000..a6dfcf7 Binary files /dev/null and b/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.dll differ diff --git a/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.pdb b/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.pdb new file mode 100644 index 0000000..396c2ca Binary files /dev/null and b/src/Plugins/DotNetHack.Plugin/obj/Debug/DotNetHack.Plugin.pdb differ diff --git a/xml/spells/shadow.xml b/src/Plugins/DotNetHack.Plugin/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs similarity index 100% rename from xml/spells/shadow.xml rename to src/Plugins/DotNetHack.Plugin/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs diff --git a/src/Plugins/DotNetHack.Plugin/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/src/Plugins/DotNetHack.Plugin/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/src/Plugins/DotNetHack.Plugin/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/src/Plugins/DotNetHack.Plugin/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/src/Server/DotNetHack.Server/AssemblyInfo.cs b/src/Server/DotNetHack.Server/AssemblyInfo.cs new file mode 100644 index 0000000..037bde7 --- /dev/null +++ b/src/Server/DotNetHack.Server/AssemblyInfo.cs @@ -0,0 +1,47 @@ +// +// AssemblyInfo.cs +// +// Author: +// PJensen +// +// Copyright (c) 2012 Peter J. Jensen +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("DotNetHack.Server")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("pjensen")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] + diff --git a/src/Server/DotNetHack.Server/DotNetHack.Server.csproj b/src/Server/DotNetHack.Server/DotNetHack.Server.csproj new file mode 100644 index 0000000..f8e7927 --- /dev/null +++ b/src/Server/DotNetHack.Server/DotNetHack.Server.csproj @@ -0,0 +1,86 @@ + + + + Debug + x86 + 9.0.21022 + 2.0 + {CF2A5A92-69F8-4527-A573-EE10D612B697} + Exe + DotNetHack.Server + DotNetHack.Server + v4.5 + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + x86 + true + false + + + none + true + bin\Release + prompt + 4 + x86 + true + false + + + + + + + + + + + + {BE13084A-561B-4B51-B546-68D662D64AF3} + DotNetHack.Data + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + \ No newline at end of file diff --git a/src/Server/DotNetHack.Server/EntryPoint.cs b/src/Server/DotNetHack.Server/EntryPoint.cs new file mode 100644 index 0000000..dd046ee --- /dev/null +++ b/src/Server/DotNetHack.Server/EntryPoint.cs @@ -0,0 +1,37 @@ +// +// Main.cs +// +// Author: +// PJensen +// +// Copyright (c) 2012 Peter J. Jensen +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . + +using DotNetHack.Data; + +namespace DotNetHack.Server +{ + class EntryPoint + { + public static void Main(string[] args) + { + Database db = new Database("localhost", "DNH", "pjensen"); + + db.Open(); + + db.Close(); + } + } +} diff --git a/src/Server/DotNetHack.Server/app.config b/src/Server/DotNetHack.Server/app.config new file mode 100644 index 0000000..b7a7ef1 --- /dev/null +++ b/src/Server/DotNetHack.Server/app.config @@ -0,0 +1,3 @@ + + + diff --git a/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Data.dll b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Data.dll new file mode 100644 index 0000000..f8a63ff Binary files /dev/null and b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Data.dll differ diff --git a/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Data.pdb b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Data.pdb new file mode 100644 index 0000000..fe6e809 Binary files /dev/null and b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Data.pdb differ diff --git a/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe new file mode 100755 index 0000000..fc68ce6 Binary files /dev/null and b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe differ diff --git a/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe.config b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe.config new file mode 100644 index 0000000..b7a7ef1 --- /dev/null +++ b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe.config @@ -0,0 +1,3 @@ + + + diff --git a/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe.mdb b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe.mdb new file mode 100644 index 0000000..512f893 Binary files /dev/null and b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.exe.mdb differ diff --git a/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.pdb b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.pdb new file mode 100644 index 0000000..10c65ba Binary files /dev/null and b/src/Server/DotNetHack.Server/bin/Debug/DotNetHack.Server.pdb differ diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/src/Server/DotNetHack.Server/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..dacf4a4 Binary files /dev/null and b/src/Server/DotNetHack.Server/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.csproj.FileListAbsolute.txt b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..824c07c --- /dev/null +++ b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.csproj.FileListAbsolute.txt @@ -0,0 +1,8 @@ +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\bin\Debug\DotNetHack.Server.exe.config +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\bin\Debug\DotNetHack.Server.exe +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\bin\Debug\DotNetHack.Server.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\bin\Debug\DotNetHack.Data.dll +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\bin\Debug\DotNetHack.Data.pdb +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\obj\x86\Debug\DotNetHack.Server.csprojResolveAssemblyReference.cache +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\obj\x86\Debug\DotNetHack.Server.exe +C:\Users\Pete Jensen\Documents\GitHub\DotNetHack\src\Server\DotNetHack.Server\obj\x86\Debug\DotNetHack.Server.pdb diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.csprojResolveAssemblyReference.cache b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..f7751b3 Binary files /dev/null and b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.csprojResolveAssemblyReference.cache differ diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.exe b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.exe new file mode 100644 index 0000000..fc68ce6 Binary files /dev/null and b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.exe differ diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.pdb b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.pdb new file mode 100644 index 0000000..10c65ba Binary files /dev/null and b/src/Server/DotNetHack.Server/obj/x86/Debug/DotNetHack.Server.pdb differ diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/src/Server/DotNetHack.Server/obj/x86/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/src/Server/DotNetHack.Server/obj/x86/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/src/Server/DotNetHack.Server/obj/x86/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/src/Server/DotNetHack.Server/obj/x86/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/src/Tests/DotNetHack.TestUnit/DotNetHack.mdproj b/src/Tests/DotNetHack.TestUnit/DotNetHack.mdproj new file mode 100644 index 0000000..e33e5a8 --- /dev/null +++ b/src/Tests/DotNetHack.TestUnit/DotNetHack.mdproj @@ -0,0 +1,11 @@ + + + + Default + AnyCPU + NUnitAssemblyGroupProject + 9.0.21022 + 2.0 + {A2C1AD07-8286-4E65-BAF1-32FBC63261C1} + + \ No newline at end of file diff --git a/src/Tests/DotNetHack.TestUnit/test-results/DotNetHack.mdproj-Default-2012-07-04.xml b/src/Tests/DotNetHack.TestUnit/test-results/DotNetHack.mdproj-Default-2012-07-04.xml new file mode 100644 index 0000000..b3976bf --- /dev/null +++ b/src/Tests/DotNetHack.TestUnit/test-results/DotNetHack.mdproj-Default-2012-07-04.xml @@ -0,0 +1,60 @@ + + + + + 2012-07-04T19:01:58 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:03 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:07 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:18 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:18 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + \ No newline at end of file diff --git a/src/Tests/DotNetHack.TestUnit/test-results/{ECDC98B3-347F-4A7E-A2FD-45A1B5D1AA27}-default-2012-07-04.xml b/src/Tests/DotNetHack.TestUnit/test-results/{ECDC98B3-347F-4A7E-A2FD-45A1B5D1AA27}-default-2012-07-04.xml new file mode 100644 index 0000000..253b1aa --- /dev/null +++ b/src/Tests/DotNetHack.TestUnit/test-results/{ECDC98B3-347F-4A7E-A2FD-45A1B5D1AA27}-default-2012-07-04.xml @@ -0,0 +1,49 @@ + + + + + 2012-07-04T19:01:58 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:03 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:07 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:18 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + \ No newline at end of file diff --git a/src/test-results/{BC3727A6-7C7B-42D7-A735-E7BE55A76D98}-default-2012-07-04.xml b/src/test-results/{BC3727A6-7C7B-42D7-A735-E7BE55A76D98}-default-2012-07-04.xml new file mode 100644 index 0000000..4b9b6bb --- /dev/null +++ b/src/test-results/{BC3727A6-7C7B-42D7-A735-E7BE55A76D98}-default-2012-07-04.xml @@ -0,0 +1,27 @@ + + + + + 2012-07-04T19:02:07 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 2012-07-04T19:02:18 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + \ No newline at end of file diff --git a/uml/Concrete_0.0.2.png b/uml/Concrete_0.0.2.png deleted file mode 100644 index 44fa9a8..0000000 Binary files a/uml/Concrete_0.0.2.png and /dev/null differ diff --git a/uml/Interfaces_0.0.2.png b/uml/Interfaces_0.0.2.png deleted file mode 100644 index bfe1880..0000000 Binary files a/uml/Interfaces_0.0.2.png and /dev/null differ diff --git a/willowshire.dungeon b/willowshire.dungeon deleted file mode 100644 index 01cf1fc..0000000 Binary files a/willowshire.dungeon and /dev/null differ diff --git a/xml/potions/fire.xml b/xml/potions/fire.xml deleted file mode 100644 index 52966b2..0000000 --- a/xml/potions/fire.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/xml/potions/healing.xml b/xml/potions/healing.xml deleted file mode 100644 index 8f3eb60..0000000 --- a/xml/potions/healing.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/xml/spells/fire.xml b/xml/spells/fire.xml deleted file mode 100644 index f2ade1a..0000000 --- a/xml/spells/fire.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/xml/spells/healing.xml b/xml/spells/healing.xml deleted file mode 100644 index 1255d51..0000000 --- a/xml/spells/healing.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - -