LapisPuzzle-1.2004075500017500000144000000000001161001373300130175ustar multixusersLapisPuzzle-1.2/English.lproj004075500017500000144000000000001156727341400155545ustar multixusersLapisPuzzle-1.2/English.lproj/LapisPuzzle.nib004075500017500000144000000000001156727341400206055ustar multixusersLapisPuzzle-1.2/English.lproj/LapisPuzzle.nib/classes.nib010064400017500000144000000021471156155270300230070ustar multixusers{ IBClasses = ( {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { ACTIONS = {restart = id; }; CLASS = LPController; LANGUAGE = ObjC; OUTLETS = { attackList = id; lpview1 = LapisPuzzleView; lpview2 = LapisPuzzleView; next1 = id; next2 = id; }; SUPERCLASS = NSObject; }, {CLASS = LPGroupUnit; LANGUAGE = ObjC; SUPERCLASS = LPUnit; }, {CLASS = LPJewelUnit; LANGUAGE = ObjC; SUPERCLASS = LPUnit; }, {CLASS = LPSparkerUnit; LANGUAGE = ObjC; SUPERCLASS = LPJewelUnit; }, {CLASS = LPStoneUnit; LANGUAGE = ObjC; SUPERCLASS = LPJewelUnit; }, {CLASS = LPUnit; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = LapisNextView; LANGUAGE = ObjC; SUPERCLASS = LapisPuzzleView; }, { CLASS = LapisPuzzleView; LANGUAGE = ObjC; OUTLETS = {"__owner" = id; }; SUPERCLASS = NSView; } ); IBVersion = 1; }LapisPuzzle-1.2/English.lproj/LapisPuzzle.nib/info.nib010064400017500000144000000011071156155270300223000ustar multixusers IBDocumentLocation 22 -6 356 240 0 0 800 578 IBEditorPositions 29 27 350 318 44 0 0 800 578 IBFramework Version 364.0 IBOpenObjects 29 21 IBSystem Version 7W98 LapisPuzzle-1.2/English.lproj/LapisPuzzle.nib/objects.nib010064400017500000144000000062701156155270300230040ustar multixusers typedstream@NSIBObjectDataNSObjectNSCustomObject)@@NSMutableStringNSString+ NSApplicationi# NSMenuItemNSMenu̔i@@@GameNSMutableArrayNSArray i@@IIi@@@@:i@New GamenNSCustomResource)NSImageNSMenuCheckmarkNSMenuMixedState LapisPuzzle About LapisPuzzlePreferences…,@ServicessubmenuAction:Services_NSServicesMenu@Hide LapisPuzzleh Hide OthershShow All@Quit LapisPuzzleq _NSAppleMenu@MainMenuɠɠɠWindowWindowРZoomРMinimizemР@РBring All to Front_NSWindowsMenuɠHelp݄ޠLapisPuzzle Help? _NSMainMenuɖЖ NSBrowser< NSControl)NSView) NSResponder璅 @@@@ffffffff NSCustomView) 钅LapisPuzzleViewNSView}2d2d钅 LapisNextView[}2d2d钅 钅NSView䆅  钅icc@[8c] @@@::#sssi NSBrowserCellNSCellAii@@@@@ BrowserItemNSFont$[36c]LucidaGrandef c/BrowserNSMatrix>d@Ζ閱ɖܖޖɖ«ЖɖЖ̖鄄NSWindowTemplate iiffffi@@@@@cd&px LapisPuzzleNSWindowViewffff BffՁ閴ī͖ūЖ閄 LPController9ɄMainMenu܄1䄙 NSBrowser1넙ViewView3121ބ2 File's Owner󄙙View2Windowń1111View1 NSMutableSetNSSetINSNibControlConnectorτNSNibConnector@@@ՅperformMiniaturize:مarrangeInFront: showHelp:ŕ terminate:orderFrontStandardAboutPanel:hideOtherApplications:hide:•unhideAllApplications:Ӆ performZoom:NSNibOutletConnectordelegate/䄙 attackList/next1/󄙙next2/넙lpview1/lpview2/__owner/<restart6@i38j=: z>ŁQ(5o%7*,$.g9Sā9R1Ӂ;\'&"ۚIBCocoaFrameworkLapisPuzzle-1.2/English.lproj/InfoPlist.strings010064400017500000144000000004061156155270300211450ustar multixusers/* Localized versions of Info.plist keys */ CFBundleName = "LapisPuzzle"; NSHumanReadableCopyright = " __MyCompanyName__, 2011";LapisPuzzle-1.2/GNUmakefile010064400017500000144000000011031160777144000151540ustar multixusersinclude $(GNUSTEP_MAKEFILES)/common.make PACKAGE_NAME = LapisPuzzle VERSION = 1.2 APP_NAME = LapisPuzzle LapisPuzzle_MAIN_MODEL_FILE = LapisPuzzle.gorm LapisPuzzle_HEADER_FILES = LPController.h \ LapisPuzzle.h \ LapisPuzzleView.h LapisPuzzle_OBJC_FILES = main.m \ LPController.m \ LapisPuzzleView.m LapisPuzzle_APPLICATION_ICON = LapisPuzzle.tiff LapisPuzzle_RESOURCE_FILES = LapisPuzzle.gorm LapisPuzzle.tiff LapisPuzzleInfo.plist -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/application.make LapisPuzzle-1.2/ANNOUNCE010064400017500000144000000004111031363230000142140ustar multixusersLapisPuzzle =========== By Banlu Kemiyatorn. A tetris-like game where each player is effected by the others game play. When one player clears blocks, the other gets more put on! Attractive graphics as well. Available for download at: http://www.nongnu.org/gapLapisPuzzle-1.2/COPYING010064400017500000144000000430761007706630000141440ustar multixusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 Library 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 Appendix: 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) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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 Library General Public License instead of this License. LapisPuzzle-1.2/LapisPuzzleInfo.plist010064400017500000144000000007201160777144000172610ustar multixusers{ ApplicationDescription = "A garma puzzle game"; ApplicationName = LapisPuzzle; ApplicationIcon = LapisPuzzle; ApplicationRelease = "1.2"; Authors = ("GAP Team","Banlu Kemiyatorn "); Copyright = "Copyright \u00a9 2004-2011 GNUstep Application Project"; CopyrightDescription = "Released under the GNU General Public License 2.0 and later version"; URL = "http://gap.nongnu.org/lapispuzzle/index.html"; FullVersionID = "1.2"; } LapisPuzzle-1.2/GNUmakefile.preamble010064400017500000144000000010661077636434400167610ustar multixusers# # GNUmakefile.preamble - Generated by ProjectCenter # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to Objective C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to C compiler ADDITIONAL_CFLAGS += # Additional flags to pass to the linker ADDITIONAL_LDFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += #Enable this for windows #ADDITIONAL_GUI_LIBS += -liberty LapisPuzzle-1.2/LPController.h010064400017500000144000000024241156727341300156430ustar multixusers/* * LPController.h * Copyright 2004-2011 The Free Software Foundation * * Copyright (C) 2004 Banlu Kemiyatorn. * July 19, 2004 * Written by Banlu Kemiyatorn * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * This library 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 * Library General Public License for more details. * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import #import "LapisPuzzleView.h" @interface LPController : NSObject { IBOutlet LapisPuzzleView *lpview1; IBOutlet LapisPuzzleView *lpview2; IBOutlet id attackList; IBOutlet id next1; IBOutlet id next2; NSMutableArray *attackArray; NSTimer *tick; } - (IBAction) restart:(id)sender; - (void) player:(id)pl processStone:(int)num; @end LapisPuzzle-1.2/LPController.m010064400017500000144000000121071157177246500156550ustar multixusers/* * LPController.m * Copyright 2004-2011 The Free Software Foundation * * Copyright (C) 2004 Banlu Kemiyatorn. * July 19, 2004 * Written by Banlu Kemiyatorn * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * This library 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 * Library General Public License for more details. * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import #import "LPController.h" #define ROUND_TIME 0.8 #define AI_SPEED 0.1 #define REFRESH_RATE 0.2 @implementation LPController - (void) applicationWillFinishLaunching: (NSNotification*)aNotification { NSTimer *tickr = nil; attackArray = [NSMutableArray new]; srandom([[NSCalendarDate date] timeIntervalSince1970]); [lpview1 setBackgroundImage:[NSImage imageNamed:@"bg1.jpg"]]; [lpview2 setBackgroundImage:[NSImage imageNamed:@"bg2.jpg"]]; [lpview2 toggleAI]; [next1 setBackgroundImage:[NSImage imageNamed:@"bg1.jpg"]]; [next2 setBackgroundImage:[NSImage imageNamed:@"bg2.jpg"]]; ASSIGN(tick, [NSTimer scheduledTimerWithTimeInterval:ROUND_TIME target:self selector:@selector(round) userInfo:nil repeats:YES]); ASSIGN(tickr, [NSTimer scheduledTimerWithTimeInterval:REFRESH_RATE target:self selector:@selector(refresh) userInfo:nil repeats:YES]); ASSIGN(tickr, [NSTimer scheduledTimerWithTimeInterval:AI_SPEED target:self selector:@selector(AIMove) userInfo:nil repeats:YES]); [[lpview1 window] makeFirstResponder:lpview1]; } - (void) simpleAI:(id)view { if ([view currentUnit] == nil) { return; } if ([[view currentUnit] X] > 3) { if (![view processDir:LP_MOVE_RIGHT]) { [view processDir:LP_MOVE_FALL]; } } else if(![view processDir:LP_MOVE_LEFT]) { if ([[view currentUnit] X] < 3) { [view processDir:LP_MOVE_FALL]; } else if (![view processDir:LP_MOVE_RIGHT]) { [view processDir:LP_MOVE_FALL]; } } } - (void) player:(id)pl processStone:(int)num { if (pl == lpview1) { [attackArray addObject:[NSString stringWithFormat:@"<--[%d]---",num]]; } else { [attackArray addObject:[NSString stringWithFormat:@"---[%d]-->",num]]; } [attackList reloadColumn:0]; } - (void) player:(id)pl addStoneToOp:(int)num { if (pl == lpview1) { pl = lpview2; } else { pl = lpview1; } [pl addStone:num]; } - (void) op:(id)pl processDir:(LPDirType)dir { if (pl == lpview1) { [lpview2 processDir:dir]; } else { [lpview1 processDir:dir]; } } - (void) refresh { [lpview1 refresh]; [lpview2 refresh]; [next1 refresh]; [next2 refresh]; } - (void) AIMove { if ([lpview1 useAI]) { [self simpleAI:lpview1]; } if ([lpview2 useAI]) { [self simpleAI:lpview2]; } } - (void) round { [lpview1 round]; [lpview2 round]; } - (void) lapisPuzzleView:(LapisPuzzleView *)sender didFinishUnitWithResult:(LPResultType)result { id unit; switch(result) { case LP_RESULT_REQUEST: if (sender == lpview1) { [next1 fallEmDown]; [next1 addJewelUnit]; unit = [next1 getUnitAtX:0 Y:0]; if (unit) { [unit setOwner:lpview1]; [unit rMoveX:3 Y:14]; [lpview1 addUnit:unit]; [next1 removeUnit:unit]; } [next1 fallEmDown]; [next1 setNeedsDisplay:YES]; } else { [next2 fallEmDown]; [next2 addJewelUnit]; unit = [next2 getUnitAtX:0 Y:0]; if (unit) { [unit setOwner:lpview2]; [unit rMoveX:3 Y:14]; [lpview2 addUnit:unit]; [next2 removeUnit:unit]; } [next2 fallEmDown]; [next2 setNeedsDisplay:YES]; } break; case LP_RESULT_GAMEOVER: [tick invalidate]; tick = nil; /* demo mode auto restart */ if ([lpview1 useAI] && [lpview2 useAI]) { [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(restart:) userInfo:nil repeats:NO]; } break; } } - (IBAction) restart:(id)sender { [tick invalidate]; tick = nil; [attackArray removeAllObjects]; [attackList reloadColumn:0]; [lpview1 restart]; [lpview2 restart]; ASSIGN(tick, [NSTimer scheduledTimerWithTimeInterval:ROUND_TIME target:self selector:@selector(round) userInfo:nil repeats:YES]); } - (int) browser:(NSBrowser *)sender numberOfRowsInColumn:(int)column { return [attackArray count]; } - (void) browser: (NSBrowser *)sender willDisplayCell: (NSBrowserCell *)cell atRow: (int)row column: (int)column { [cell setTitle:[attackArray objectAtIndex:row]]; [cell setLeaf:YES]; } @end LapisPuzzle-1.2/LapisPuzzle.h010064400017500000144000000015441007706630000155360ustar multixusers/* * LapisPuzzle.h * Copyright (C) 2004 Banlu Kemiyatorn. * July 19, 2004 * Written by Banlu Kemiyatorn * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * This library 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 * Library General Public License for more details. * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ LapisPuzzle-1.2/LapisPuzzle.tiff010064400017500000144000000224761007706630000162460ustar multixusersMM*$**OY {{EE,,WWrr00 KK..3333NN!!55dd==## UU{{,, @@TT&& ggaa==  <<AA!!  ww  ))DD++ %% @@>>;;22  ((::885533%% 774422// ))11..&& --++ **''        :: ::RR ZZdd++ cc``CC AA``]]ZZ$$  __\\ZZWW;; ))[[YYVVTTJJ ++VVUUSSPPNN-- |))HHOOMMJJBB 88GGDDyK,,{zhh5!** zvhhhhP hhhT ohhM55 hfZ!%%h[gp0jzRRJJ&&ZZ1100$ )$%@$%.%6(R/Users/id/Sync/Projects/LapisPuzzle.tiffCreated with The GIMPHHLapisPuzzle-1.2/main.m010064400017500000144000000020101156727341400142050ustar multixusers/* * main.m * Copyright (C) 2004 Banlu Kemiyatorn. * 2004-2011 The GNUstep Application Project * * July 19, 2004 * Written by Banlu Kemiyatorn * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * This library 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 * Library General Public License for more details. * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import int main(int argc, const char **argv) { return NSApplicationMain (argc, argv); } LapisPuzzle-1.2/TODO010064400017500000144000000001061007706630000135640ustar multixusersCheck both white sparkers. (now only check one) Rotation seems wrong. LapisPuzzle-1.2/LapisPuzzleView.h010064400017500000144000000103161157177203200163740ustar multixusers/* * LapisPuzzleView.h * Copyright 2004-2011 The Free Software Foundation * * Copyright (C) 2004 Banlu Kemiyatorn. * July 19, 2004 * Written by Banlu Kemiyatorn * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * This library 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 * Library General Public License for more details. * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import #import #import "LapisPuzzle.h" typedef enum _LPUnitColorType { LP_COLOR_BLUE, LP_COLOR_RED, LP_COLOR_GREEN, LP_COLOR_YELLOW, LP_COLOR_ALL } LPUnitColorType; typedef enum _LPDirType { LP_MOVE_UP, // for sokoban mode LP_MOVE_LEFT, LP_MOVE_RIGHT, LP_MOVE_DOWN, LP_MOVE_FALL, LP_MOVE_CW, LP_MOVE_CCW } LPDirType; @class LPUnit; @protocol LPUnitOwner - (NSArray *) allUnits; - (NSSize) gridSize; - (id) getUnitAtX:(int)x Y:(int)y; /* - (unsigned int) numberOfSteps; - (BOOL) unit:(LPUnit *)sender canMoveToDir:(LPDirType)dir; */ @end @interface LPUnit:NSObject { id __owner; LPUnitColorType _color; LPDirType _d; BOOL _isBlowing; @public float alpha; //hack } - (float) alpha; - (void) setAlpha:(float)a; - (id) initWithOwner:(id )owner color:(LPUnitColorType)color; - (void) setX:(unsigned int)x Y:(unsigned int)y; - (void) round; - (void) explode; // release self - (void) draw; - (LPUnitColorType) unitColor; - (BOOL) isBlowing; - (void) blow; - (void) setUnitColor:(LPUnitColorType)color; - (int) rows; - (int) columns; - (void) changePhase; - (int) X; - (int) Y; - (float) phase; - (void) setOwner:(id )owner; - (void) fallToBottom; - (BOOL) moveInDir:(LPDirType)dir; - (BOOL) canMoveInDir:(LPDirType)dir; - (BOOL) canRMoveX:(int)rx Y:(int)ry; - (BOOL) rMoveX:(int)rx Y:(int)ry; - (BOOL) hasPartAtX:(int)x Y:(int)y; - (void) softBlow; @end @interface LPJewelUnit:LPUnit { int _x; int _y; int _rows; int _columns; float z; } - (id) initWithOwner:(id )owner color:(LPUnitColorType)color X:(int)x Y:(int)y; - (void) addRows:(int)r; - (void) addColumns:(int)c; @end @interface LPSparkerUnit:LPJewelUnit - (void) spark; @end @interface LPStoneUnit:LPJewelUnit { int _count; /* NSMutableAttributedString *str[6]; NSSize strSize[6]; */ } - (void) countDown; - (int) count; @end @interface LPGroupUnit:LPUnit { LPDirType _laydir; NSArray *_units; } - (id) initWithOwner:(id )owner atoms:(NSArray *)unitList; - (int) X; - (int) Y; @end @class LapisPuzzleView; typedef enum _LPResultType { LP_RESULT_REQUEST, LP_RESULT_GAMEOVER } LPResultType; @protocol LPViewOwner - (void) lapisPuzzleView:(LapisPuzzleView *)sender didFinishUnitWithResult:(LPResultType)result; - (void) op:(id)pl processDir:(LPDirType)dir; - (void) player:(id)pl addStoneToOp:(int)num; @end #define LP_FALLING_ITEMS 2 @interface LapisPuzzleView:NSView { BOOL _gameOver; IBOutlet id __owner; float _stepHeight; float _stepWidth; int _stepsInUnit; NSImage *_background; int _numberOfRows; int _numberOfColumns; id __currentUnit; NSMutableArray *_units; NSMutableArray *_blowing; int chain; int stone; int trip; int chaintrip; int maxchain; BOOL _useAI; BOOL _lockControl; } - (void) setBackgroundImage:(NSImage *)image; - (void) gameOver; - (void) addJewelUnit; - (void) round; - (void) addUnit:(id)newUnit; - (void) addStone:(int)num; - (void) refresh; - (void) restart; - (void) blowIt; - (void) packCell; - (void) fallEmDown; - (void) runStone; - (BOOL) processDir:(LPDirType)dir; - (id) currentUnit; - (void) toggleAI; - (BOOL) useAI; @end @interface LapisNextView:LapisPuzzleView - (void) removeUnit:(id)unit; @end LapisPuzzle-1.2/LapisPuzzleView.m010064400017500000144000001174721157177221300164150ustar multixusers/* * LapisPuzzleView.m * Copyright 2004-2011 The Free Software Foundation * * Copyright (C) 2004 Banlu Kemiyatorn. * July 19, 2004 * Written by Banlu Kemiyatorn * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * This library 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 * Library General Public License for more details. * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import "LapisPuzzleView.h" #import "LPController.h" #include static float _grid_height; #define MATCH_COLOR(a,b) ((a == b)) @implementation LPUnit - (id) description { return [NSString stringWithFormat:@"<%@: %p %d>",[self className], self, _color]; } + (void) setGridHeight:(float)points { _grid_height = points; } - (id) initWithOwner:(id )owner color:(LPUnitColorType)color { alpha = 1.0; __owner = owner; _color = color; _isBlowing = NO; return self; } - (void) setOwner:(id )owner { __owner = owner; } - (float) alpha { return alpha; } - (void) setAlpha:(float)a { if (a < 0) a = 0; alpha = a; } - (LPUnitColorType) unitColor { return _color; } - (void) setUnitColor:(LPUnitColorType)color { _color = color; } - (int) rows { return 0; } - (int) columns { return 0; } - (BOOL) hasPartAtX:(int)x Y:(int)y { return NO; } - (void) fallToBottom { while ([self moveInDir:LP_MOVE_DOWN]); } - (BOOL) isBlowing { return _isBlowing; } - (void) softBlow { _isBlowing = YES; } - (void) blow { int unit_x, unit_y, unit_rows, unit_columns; int i; id m; if (_isBlowing) { return; } _isBlowing = YES; unit_x = [self X]; unit_y = [self Y]; unit_rows = [self rows]; unit_columns = [self columns]; for (i = 0; i < unit_columns; i++) { m = [__owner getUnitAtX:unit_x + i Y:unit_y - 1]; if (m && (MATCH_COLOR([m unitColor], _color) || [m isMemberOfClass:[LPStoneUnit class]])) { [m blow]; } m = [__owner getUnitAtX:unit_x + i Y:unit_y + unit_rows]; if (m && (MATCH_COLOR([m unitColor], _color) || [m isMemberOfClass:[LPStoneUnit class]])) { [m blow]; } } for (i = 0; i < unit_rows; i++) { m = [__owner getUnitAtX:unit_x - 1 Y:unit_y + i]; if (m && (MATCH_COLOR([m unitColor], _color) || [m isMemberOfClass:[LPStoneUnit class]])) { [m blow]; } m = [__owner getUnitAtX:unit_x + unit_columns Y:unit_y + i]; if (m && (MATCH_COLOR([m unitColor], _color) || [m isMemberOfClass:[LPStoneUnit class]])) { [m blow]; } } } /** subclass responsibility **/ - (BOOL) moveInDir:(LPDirType)dir { return NO; } - (BOOL) rMoveX:(int)rx Y:(int)ry { return NO; } - (void) changePhase { } - (int) X { return 0; } - (int) Y { return 0; } - (float) phase { return 0.0; } - (void) explode { } - (void) draw { } - (void) round { } - (void) setX:(unsigned int)x Y:(unsigned int)y { } - (BOOL) canMoveInDir:(LPDirType)dir { return NO; } - (BOOL) canRMoveX:(int)rx Y:(int)ry { return NO; } @end @implementation LPStoneUnit; - (id) initWithOwner:(id )owner color:(LPUnitColorType)color X:(int)x Y:(int)y { _count = 5; return [super initWithOwner:owner color:color X:x Y:y]; } - (int) count { return _count; } - (void) countDown { _count--; } - (void) draw { int i; NSColor *tcolor; NSMutableAttributedString *str; NSSize strSize; NSSize gz = [__owner gridSize]; float border = gz.width/6; [super draw]; PSsetrgbcolor(0.7,0.7,0.7); PSsetalpha(alpha); PSrectfill(_x * gz.width , _y *gz.height, _columns * gz.width, _rows * gz.height); PSsetrgbcolor(1,1,1); PSsetalpha(alpha/3); PSsetlinewidth(0); PSmoveto(_x * gz.width, _y * gz.height); PSlineto(_x * gz.width + gz.width/4, _y * gz.height + gz.width/4); PSlineto(_x * gz.width + gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto(_x * gz.width, (_y+_rows) * gz.height); PSfill(); PSsetalpha(alpha); PSsetlinewidth(0); PSmoveto(_x * gz.width, (_y+_rows) * gz.height); PSlineto(_x * gz.width + gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto((_x+_columns) * gz.width - gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto((_x+_columns) * gz.width, (_y+_rows) * gz.height); PSfill(); for (i = 0; i <_rows; i+=2) { PSgsave(); PSsetlinecap(1); PSsetalpha(alpha/10); PSsetlinewidth(_columns * border * 4); PSrectclip(_x * gz.width + gz.width/4, _y *gz.height + gz.height/4, _columns * gz.width - gz.width/2, _rows * gz.height - gz.height/2); PSmoveto(_x * gz.width, (_y + i) * gz.height); PSlineto((_x + _columns) * gz.width, (_y + i + _columns) * gz.height); PSstroke(); PSgrestore(); } for (i = 0; i <_rows; i++) { PSgsave(); PSsetlinecap(1); PSsetlinewidth(_columns * border * 2); PSrectclip(_x * gz.width + gz.width/4, _y *gz.height + gz.height/4, _columns * gz.width - gz.width/2, _rows * gz.height - gz.height/2); PSsetalpha(alpha/4); PSmoveto(_x * gz.width, (_y + i*4) * gz.height + (i + _rows) * 10); PSlineto((_x + _columns) * gz.width, (_y + i*4 + _columns) * gz.height + (i + _rows) * 10); PSstroke(); PSgrestore(); } PSsetrgbcolor(0.3,0.3,0.3); PSsetalpha(alpha/2); PSsetlinewidth(0); PSmoveto(_x * gz.width, _y * gz.height); PSlineto(_x * gz.width + gz.width/4, _y * gz.height + gz.width/4); PSlineto((_x+_columns) * gz.width - gz.width/4, _y * gz.height + gz.width/4); PSlineto((_x+_columns) * gz.width, _y * gz.height); PSfill(); PSsetalpha(alpha/3); PSsetlinewidth(0); PSmoveto((_x+_columns) * gz.width, _y * gz.height); PSlineto((_x+_columns) * gz.width - gz.width/4, _y * gz.height + gz.width/4); PSlineto((_x+_columns) * gz.width - gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto((_x+_columns) * gz.width, (_y+_rows) * gz.height); PSfill(); /****/ PSsetrgbcolor(0,0,0); PSsetalpha(0.8); PSrectfill(_x * gz.width + gz.width/8, _y *gz.height + gz.height/8, gz.width - gz.width/4, gz.height - gz.height/4); switch (_color) { case LP_COLOR_YELLOW: tcolor = [NSColor yellowColor]; break; case LP_COLOR_GREEN: tcolor = [NSColor greenColor]; break; case LP_COLOR_RED: tcolor = [NSColor redColor]; break; case LP_COLOR_BLUE: tcolor = [NSColor blueColor]; break; default: tcolor = [NSColor grayColor]; } str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d",_count]]; [str addAttribute:NSForegroundColorAttributeName value:tcolor range:NSMakeRange(0,1)]; [str addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:gz.height/1.5] range:NSMakeRange(0,1)]; strSize = [str size]; PSsetalpha(alpha); [str drawAtPoint:NSMakePoint(_x * gz.width + gz.width/2 - strSize.width/2, _y * gz.height + gz.height/2 - strSize.height/2)]; } - (void) blow { _isBlowing = YES; } @end @implementation LPSparkerUnit - (void) spark { int unit_x, unit_y, unit_rows, unit_columns; int i; id m; unit_x = [self X]; unit_y = [self Y]; unit_rows = [self rows]; unit_columns = [self columns]; for (i = 0; i < unit_columns; i++) { m = [__owner getUnitAtX:unit_x + i Y:unit_y - 1]; if (m && MATCH_COLOR([m unitColor],_color) && ![m isMemberOfClass:[LPStoneUnit class]]) { [self blow]; } m = [__owner getUnitAtX:unit_x + i Y:unit_y + unit_rows]; if (m && MATCH_COLOR([m unitColor],_color) && ![m isMemberOfClass:[LPStoneUnit class]]) { [self blow]; } } for (i = 0; i < unit_rows; i++) { m = [__owner getUnitAtX:unit_x - 1 Y:unit_y + i]; if (m && MATCH_COLOR([m unitColor], _color) && ![m isMemberOfClass:[LPStoneUnit class]]) { [self blow]; } m = [__owner getUnitAtX:unit_x + unit_columns Y:unit_y + i]; if (m && MATCH_COLOR([m unitColor], _color) && ![m isMemberOfClass:[LPStoneUnit class]]) { [self blow]; } } } - (void) draw { NSSize gz = [__owner gridSize]; float border = gz.width/7; switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0,0.5); break; case LP_COLOR_RED: PSsetrgbcolor(0.5,0,0); break; case LP_COLOR_GREEN: PSsetrgbcolor(0,0.5,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(0.5,0.5,0); break; default: PSsetrgbcolor(0.5,0.5,0.5); break; } PSmoveto(_x * gz.width + gz.width/2, _y * gz.height); PSlineto(_x * gz.width + border, _y * gz.height + border); PSlineto(_x * gz.width, _y * gz.height + gz.height/2); PSlineto(_x * gz.width + border, (_y+1) * gz.height - border); PSlineto(_x * gz.width + gz.width/2, (_y+1) * gz.height); PSlineto((_x+1) * gz.width - border, (_y+1) * gz.height - border); PSlineto((_x+1) * gz.width, _y * gz.height + gz.height/2); PSlineto((_x+1) * gz.width - border, _y * gz.height + border); PSclosepath(); PSsetalpha(alpha); PSfill(); switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0,1.0-z); break; case LP_COLOR_RED: PSsetrgbcolor(1.0-z,0,0); break; case LP_COLOR_GREEN: PSsetrgbcolor(0,1.0-z,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(1.0-z,1.0-z,0); break; default: PSsetrgbcolor(1.0-z,1.0-z,1.0-z); break; } PSmoveto(_x * gz.width + gz.width/2, _y * gz.height); PSrlineto(gz.width/2, gz.height/2); PSrlineto(-gz.width/2, gz.height/2); PSrlineto(-gz.width/2, -gz.height/2); PSclosepath(); PSsetalpha(alpha); PSfill(); switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0,0.5+z); break; case LP_COLOR_RED: PSsetrgbcolor(0.5+z,0,0); break; case LP_COLOR_GREEN: PSsetrgbcolor(0,0.5+z,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(0.5+z,0.5+z,0); break; default: PSsetrgbcolor(0.5+z,0.5+z,0.5+z); break; } PSsetalpha(alpha/1.5); PSrectfill(_x * gz.width + border , _y *gz.height + border, _columns * gz.width - border*2, _rows * gz.height - border*2); switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0,1.0-z); break; case LP_COLOR_RED: PSsetrgbcolor(1.0-z,0,0); break; case LP_COLOR_GREEN: PSsetrgbcolor(0,1.0-z,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(1.0-z,1.0-z,0); break; default: PSsetrgbcolor(1.0-z,1.0-z,1.0-z); break; } PSsetalpha(alpha/2); PSmoveto(_x * gz.width + gz.width/2, _y * gz.height); PSlineto(_x * gz.width + border, _y * gz.height + border); PSlineto(_x * gz.width, _y * gz.height + gz.height/2); PSlineto(_x * gz.width + border, (_y+1) * gz.height - border); PSlineto(_x * gz.width + gz.width/2, (_y+1) * gz.height); PSlineto((_x+1) * gz.width - border, (_y+1) * gz.height - border); PSlineto((_x+1) * gz.width, _y * gz.height + gz.height/2); PSlineto((_x+1) * gz.width - border, _y * gz.height + border); PSlineto(_x * gz.width + gz.width/2, _y * gz.height); PSlineto((_x+1) * gz.width, _y * gz.height + gz.height/2); PSlineto(_x * gz.width + gz.width/2, (_y+1) * gz.height); PSlineto(_x * gz.width, _y * gz.height + gz.height/2); PSclosepath(); PSfill(); } @end @implementation LPJewelUnit - (id) initWithOwner:(id )owner color:(LPUnitColorType)color X:(int)x Y:(int)y { [super initWithOwner:owner color:color]; _x = x; _y = y; _rows = 1; _columns = 1; z = random()%5; z/= 10; [self changePhase]; return self; } - (float) phase { return z; } - (void) changePhase { z += 0.1; if (z > 0.5) { z = 0; } } - (int) rows { return _rows; } - (int) columns { return _columns; } - (int) X { return _x; } - (int) Y { return _y; } - (void) draw { NSSize gz = [__owner gridSize]; float border = gz.width/6; switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0,0.7); break; case LP_COLOR_RED: PSsetrgbcolor(0.7,0,0); break; case LP_COLOR_GREEN: PSsetrgbcolor(0,0.7,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(0.7,0.7,0); break; default: PSsetrgbcolor(0.7,0.7,0.7); break; } PSsetalpha(alpha); PSrectfill(_x * gz.width , _y *gz.height, _columns * gz.width, _rows * gz.height); switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0,0.6); break; case LP_COLOR_RED: PSsetrgbcolor(0.6,0,0); break; case LP_COLOR_GREEN: PSsetrgbcolor(0,0.6,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(0.6,0.6,0); break; default: PSsetrgbcolor(0.6,0.6,0.6); break; } PSsetalpha(alpha); //PSrectfill(_x * gz.width + border, _y *gz.height + border, _columns * gz.width - 2*border, _rows * gz.height - 2*border); switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0.5,1); break; case LP_COLOR_RED: PSsetrgbcolor(1,0.2,0.2); break; case LP_COLOR_GREEN: PSsetrgbcolor(0.5,1,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(1,1,0.0); break; default: PSsetrgbcolor(1,1,1); break; } PSsetalpha(alpha/3); PSsetlinewidth(0); PSmoveto(_x * gz.width, _y * gz.height); PSlineto(_x * gz.width + gz.width/4, _y * gz.height + gz.width/4); PSlineto(_x * gz.width + gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto(_x * gz.width, (_y+_rows) * gz.height); PSfill(); PSsetalpha(alpha); PSsetlinewidth(0); PSmoveto(_x * gz.width, (_y+_rows) * gz.height); PSlineto(_x * gz.width + gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto((_x+_columns) * gz.width - gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto((_x+_columns) * gz.width, (_y+_rows) * gz.height); PSfill(); if (_rows > 1) { int i; for (i = 0; i <_rows; i+=2) { PSgsave(); PSsetlinecap(1); PSsetalpha(alpha/10); PSsetlinewidth(_columns * border * 4); PSrectclip(_x * gz.width + gz.width/4, _y *gz.height + gz.height/4, _columns * gz.width - gz.width/2, _rows * gz.height - gz.height/2); PSmoveto(_x * gz.width, (_y + i) * gz.height); PSlineto((_x + _columns) * gz.width, (_y + i + _columns) * gz.height); PSstroke(); PSgrestore(); } for (i = 0; i <_rows; i++) { PSgsave(); PSsetlinecap(1); PSsetlinewidth(_columns * border * 2); PSrectclip(_x * gz.width + gz.width/4, _y *gz.height + gz.height/4, _columns * gz.width - gz.width/2, _rows * gz.height - gz.height/2); PSsetalpha(alpha/4); PSmoveto(_x * gz.width, (_y + i*4) * gz.height + (i + _rows) * 10); PSlineto((_x + _columns) * gz.width, (_y + i*4 + _columns) * gz.height + (i + _rows) * 10); PSstroke(); PSgrestore(); } } switch (_color) { case LP_COLOR_BLUE: PSsetrgbcolor(0,0,0.3); break; case LP_COLOR_RED: PSsetrgbcolor(0.3,0,0); break; case LP_COLOR_GREEN: PSsetrgbcolor(0,0.3,0); break; case LP_COLOR_YELLOW: PSsetrgbcolor(0.3,0.3,0); break; default: PSsetrgbcolor(0.3,0.3,0.3); break; } PSsetalpha(alpha/2); PSsetlinewidth(0); PSmoveto(_x * gz.width, _y * gz.height); PSlineto(_x * gz.width + gz.width/4, _y * gz.height + gz.width/4); PSlineto((_x+_columns) * gz.width - gz.width/4, _y * gz.height + gz.width/4); PSlineto((_x+_columns) * gz.width, _y * gz.height); PSfill(); PSsetalpha(alpha/3); PSsetlinewidth(0); PSmoveto((_x+_columns) * gz.width, _y * gz.height); PSlineto((_x+_columns) * gz.width - gz.width/4, _y * gz.height + gz.width/4); PSlineto((_x+_columns) * gz.width - gz.width/4, (_y+_rows) * gz.height - gz.width/4); PSlineto((_x+_columns) * gz.width, (_y+_rows) * gz.height); PSfill(); } - (BOOL) canRMoveX:(int)rx Y:(int)ry { id en; LPUnit* unit; int cx,cy,i,j; cx = _x + rx; cy = _y + ry; if (cx < 0 || cx > 5 || cy < 0) { return NO; } en = [[__owner allUnits] objectEnumerator]; while ((unit = [en nextObject])) { if (unit == self) { continue; } for (j = 0; j < _rows; j++) { for (i = 0; i < _columns; i++) { if ([unit hasPartAtX:cx+i Y:cy+j]) { return NO; } } } } return YES; } - (BOOL) canMoveInDir:(LPDirType)dir { int cx,cy; switch(dir) { case LP_MOVE_LEFT: if (_x == 0) { return NO; } cx = -1; cy = 0; break; case LP_MOVE_DOWN: if (_y == 0) { return NO; } cx = 0; cy = -1; break; case LP_MOVE_RIGHT: if (_x == 5) { return NO; } cx = 1; cy = 0; break; case LP_MOVE_UP: /* no check for upper border */ cx = 0; cy = 1; break; default: NSAssert(0, @"Unreachable"); return NO; break; } return [self canRMoveX:cx Y:cy]; } - (BOOL) rMoveX:(int)rx Y:(int)ry { if (![self canRMoveX:rx Y:ry]) { return NO; } _x += rx; _y += ry; return YES; } - (BOOL) moveInDir:(LPDirType)dir { if (![self canMoveInDir:dir]) { return NO; } switch(dir) { case LP_MOVE_DOWN: _y--; break; case LP_MOVE_LEFT: _x--; break; case LP_MOVE_UP: _y++; break; case LP_MOVE_RIGHT: _x++; break; default: NSAssert(0, @"Unreachable"); break; } return YES; } - (BOOL) hasPartAtX:(int)x Y:(int)y { if (x >= _x && y >= _y && x < (_x + _columns) && y < (_y + _rows)) { return YES; } return NO; } - (void) addRows:(int)r { _rows += r; } - (void) addColumns:(int)c { _columns += c; } @end @implementation LPGroupUnit - (id) initWithOwner:(id )owner atoms:(NSArray *)unitList { __owner = owner; ASSIGN(_units, unitList); _laydir = LP_MOVE_DOWN; return self; } - (NSSize) gridSize { return [__owner gridSize]; } - (NSArray *) allUnits { NSMutableArray *array = [NSMutableArray arrayWithArray:[__owner allUnits]]; [array removeObject:self]; return array; } - (NSArray *) atoms { return _units; } - (id) getUnitAtX:(int)x Y:(int)y { exit(0); // NYI } - (void) rotateCCW { id move = [_units objectAtIndex:0]; id base = [_units objectAtIndex:1]; switch(_laydir) { case LP_MOVE_DOWN: if ([move rMoveX:-1 Y:-1]) { _laydir = LP_MOVE_LEFT; } else if ([base canRMoveX:1 Y:0]) { [base rMoveX:1 Y:0]; [move rMoveX:0 Y:-1]; _laydir = LP_MOVE_LEFT; } break; case LP_MOVE_LEFT: if ([move rMoveX:1 Y:-1]) { _laydir = LP_MOVE_UP; } break; case LP_MOVE_UP: if ([move rMoveX:1 Y:1]) { _laydir = LP_MOVE_RIGHT; } else if ([base canRMoveX:-1 Y:0]) { [base rMoveX:-1 Y:0]; [move rMoveX:0 Y:1]; _laydir = LP_MOVE_RIGHT; } break; case LP_MOVE_RIGHT: if ([move rMoveX:-1 Y:1]) { _laydir = LP_MOVE_DOWN; } break; default: NSAssert(0, @"Unreachable"); break; } } - (void) rotateCW { id move = [_units objectAtIndex:0]; id base = [_units objectAtIndex:1]; switch(_laydir) { case LP_MOVE_DOWN: if ([move rMoveX:1 // should physically block rotation? Y:-1]) { _laydir = LP_MOVE_RIGHT; } else if ([base canRMoveX:-1 Y:0]) { [base rMoveX:-1 Y:0]; [move rMoveX:0 Y:-1]; _laydir = LP_MOVE_RIGHT; } break; case LP_MOVE_RIGHT: if ([move rMoveX:-1 Y:-1]) { _laydir = LP_MOVE_UP; } break; case LP_MOVE_UP: if ([move rMoveX:-1 Y:1]) { _laydir = LP_MOVE_LEFT; } else if ([base canRMoveX:1 Y:0]) { [base rMoveX:1 Y:0]; [move rMoveX:0 Y:1]; _laydir = LP_MOVE_LEFT; } break; case LP_MOVE_LEFT: if ([move rMoveX:1 Y:1]) { _laydir = LP_MOVE_DOWN; } break; default: NSAssert(0, @"Unreachable"); break; } } - (void) changePhase { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { [unit changePhase]; } } - (void) draw { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { [unit draw]; } } - (int) X { id en; LPUnit* unit; float mX; mX = 5; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit X] < mX) { mX = [unit X]; } } return mX; } - (int) Y { return 0; } - (void) dealloc { RELEASE(_units); [super dealloc]; } - (BOOL) hasPartAtX:(int)x Y:(int)y { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit hasPartAtX:x Y:y]) { return YES; } } return NO; } - (BOOL) moveInDir:(LPDirType)dir { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if([unit canMoveInDir:dir] == NO) { return NO; } } en = [_units objectEnumerator]; while ((unit = [en nextObject])) { [unit moveInDir:dir]; } return YES; } - (BOOL) canMoveInDir:(LPDirType)dir { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if([unit canMoveInDir:dir] == NO) { return NO; } } return YES; } - (BOOL) canRMoveX:(int)rx Y:(int)ry { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if([unit canRMoveX:rx Y:ry] == NO) { return NO; } } return YES; } - (BOOL) rMoveX:(int)rx Y:(int)ry { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if([unit canRMoveX:rx Y:ry] == NO) { return NO; } } en = [_units objectEnumerator]; while ((unit = [en nextObject])) { [unit rMoveX:rx Y:ry]; } return YES; } @end @implementation LapisPuzzleView static LPUnitColorType _random_unit_color() { return random()%LP_COLOR_ALL; } static LPUnit * _random_unit(id owner, int x, int y, BOOL diamond) { LPUnit* unit; if (random()%20 < 6) { if (random()%10 == 1 && diamond) { unit = [[LPSparkerUnit alloc] initWithOwner:owner color:LP_COLOR_ALL X:x Y:y]; } else { unit = [[LPSparkerUnit alloc] initWithOwner:owner color:_random_unit_color() X:x Y:y]; } } else { unit = [[LPJewelUnit alloc] initWithOwner:owner color:_random_unit_color() X:x Y:y]; } return AUTORELEASE(unit); } - (NSSize) gridSize { return NSMakeSize( NSWidth(_bounds)/(_numberOfColumns * _stepsInUnit), NSHeight(_bounds)/(((float)_numberOfRows + 0.3) * _stepsInUnit) ); } - (void) awakeFromNib { chain = 0; trip = 0; chaintrip = 0; _gameOver = NO; _numberOfRows = 13; _numberOfColumns = 6; _stepsInUnit = 1; _stepHeight = NSHeight(_frame)/((float)_numberOfRows + 0.3); _stepWidth = NSWidth(_frame)/_numberOfColumns; _units = [[NSMutableArray alloc] init]; _blowing = [[NSMutableSet alloc] init]; } - (void) setFrame:(NSRect)r { [super setFrame:r]; } - (void) setBackgroundImage:(NSImage *)image { ASSIGN(_background, image); } - (void) gameOver { _gameOver = YES; } - (void) round { id en; LPUnit* unit; if (chain) { [self fallEmDown]; [self packCell]; [self blowIt]; if (chain == 0) { [self runStone]; } [self setNeedsDisplay:YES]; return; } _lockControl = NO; if (__currentUnit == nil) { if (!_gameOver) { [__owner lapisPuzzleView:self didFinishUnitWithResult:LP_RESULT_REQUEST]; } } if(![__currentUnit moveInDir:LP_MOVE_DOWN]) { if (__currentUnit) { /* replace timer stone with jewel */ NSMutableArray *ar; _lockControl = YES; ar = [NSMutableArray array]; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit isMemberOfClass:[LPStoneUnit class]]) { [(LPStoneUnit *)unit countDown]; if ([(LPStoneUnit *)unit count] == 0) { [ar addObject:unit]; } } } en = [ar objectEnumerator]; while ((unit = [en nextObject])) { id new; new = [[LPJewelUnit alloc] initWithOwner:self color:[unit unitColor] X:[unit X] Y:[unit Y]]; [_units removeObject:unit]; [_units addObject:new]; [new release]; } en = [[__currentUnit atoms] objectEnumerator]; while ((unit = [en nextObject])) { [_units addObject:unit]; [unit setOwner:self]; [unit fallToBottom]; } [_units removeObject:__currentUnit]; __currentUnit = nil; } [self packCell]; [self blowIt]; if (chain == 0) { [self runStone]; } } [self setNeedsDisplay:YES]; } - (void) runStone { LPUnit* unit; /* run stone */ int yy,xx; if (stone > 0) { [(LPController *)__owner player:self processStone:stone]; } yy = 13, xx = 0; while (stone > 0) { unit = nil; while (unit == nil) { while (unit == nil) { if ([self getUnitAtX:xx Y:yy] == nil) { unit = [[LPStoneUnit alloc] initWithOwner:self color:_random_unit_color() X:xx Y:yy]; [_units addObject:unit]; [unit fallToBottom]; RELEASE(unit); } xx++; if (xx > 5) { xx = 0; break; } } yy++; } stone--; } } - (id) getUnitAtX:(int)x Y:(int)y { id en; LPUnit* unit; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit hasPartAtX:x Y:y]) { return unit; } } return nil; } - (void) fallEmDown { id en; LPUnit* unit; BOOL moving; /* fall em down */ do { moving = NO; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit moveInDir:LP_MOVE_DOWN]) { moving = YES; } } } while (moving); } - (void) packCell { id en; LPJewelUnit* unit; int i,j; BOOL merge; id m1,m2,m3; LPUnitColorType color; if (_gameOver) { return; } /* pack bigger cell */ for (i = 0; i < 12; i++) { for (j = 0; j < 5; j++) { unit = [self getUnitAtX:j Y:i]; if (unit && [unit rows] == 1 && [unit isMemberOfClass:[LPJewelUnit class]]) { color = [unit unitColor]; if ((m1 = [self getUnitAtX:j+1 Y:i]) && [m1 unitColor] == color && [m1 rows] == 1 && [m1 isMemberOfClass:[LPJewelUnit class]] && (m2 = [self getUnitAtX:j Y:i+1]) && [m2 unitColor] == color && [m2 rows] == 1 && [m2 isMemberOfClass:[LPJewelUnit class]] && (m3 = [self getUnitAtX:j+1 Y:i+1]) && [m3 unitColor] == color && [m3 rows] == 1 && [m3 isMemberOfClass:[LPJewelUnit class]] ) { [unit addRows:1]; [unit addColumns:1]; [_units removeObject:m1]; [_units removeObject:m2]; [_units removeObject:m3]; } } } } do { merge = NO; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { int unit_x, unit_y, unit_rows, unit_columns; LPUnitColorType color; unit_rows = [unit rows]; if (unit_rows >= 2) { NSMutableArray *ar = [NSMutableArray array]; color = [unit unitColor]; unit_x = [unit X]; unit_y = [unit Y]; unit_columns = [unit columns]; m1 = [self getUnitAtX:unit_x + unit_columns Y:unit_y]; /* check horizontal axis */ if (m1 && [m1 isMemberOfClass:[LPJewelUnit class]] && [m1 Y] == unit_y && [m1 rows] == unit_rows && [m1 unitColor] == color) { merge = YES; [unit addColumns:[m1 columns]]; [_units removeObject:m1]; break; } m1 = [self getUnitAtX:unit_x Y:unit_y + unit_rows]; /* check vertical axis */ if (m1 && [m1 isMemberOfClass:[LPJewelUnit class]] && [m1 X] == unit_x && [m1 columns] == unit_columns && [m1 unitColor] == color) { merge = YES; [unit addRows:[m1 rows]]; [_units removeObject:m1]; break; } /* check right side */ for (i = 0; i < unit_rows; i++) { m1 = [self getUnitAtX:unit_x + unit_columns Y:unit_y + i]; if (m1 == nil || ![m1 isMemberOfClass:[LPJewelUnit class]] || [m1 rows] > 1 || [m1 unitColor]!=color) { break; } [ar addObject:m1]; } if ([ar count] == unit_rows) { id en2, unit2; merge = YES; en2 = [ar objectEnumerator]; while ((unit2 = [en2 nextObject])) { [_units removeObject:unit2]; } [unit addColumns:1]; break; } /* check left side */ ar = [NSMutableArray array]; for (i = 0; i < unit_rows; i++) { m1 = [self getUnitAtX:unit_x - 1 Y:unit_y + i]; if (m1 == nil || ![m1 isMemberOfClass:[LPJewelUnit class]] || [m1 rows] > 1 || [m1 unitColor]!=color) { break; } [ar addObject:m1]; } if ([ar count] == unit_rows) { id en2, unit2; merge = YES; en2 = [ar objectEnumerator]; while ((unit2 = [en2 nextObject])) { [_units removeObject:unit2]; } [unit addColumns:1]; [unit moveInDir:LP_MOVE_LEFT]; break; } /* check top side */ ar = [NSMutableArray array]; for (i = 0; i < unit_columns; i++) { m1 = [self getUnitAtX:unit_x + i Y:unit_y + unit_rows]; if (m1 == nil || ![m1 isMemberOfClass:[LPJewelUnit class]] || [m1 rows] > 1 || [m1 unitColor]!=color) { break; } [ar addObject:m1]; } if ([ar count] == unit_columns) { id en2, unit2; merge = YES; en2 = [ar objectEnumerator]; while ((unit2 = [en2 nextObject])) { [_units removeObject:unit2]; } [unit addRows:1]; break; } /* check bottom side */ ar = [NSMutableArray array]; for (i = 0; i < unit_columns; i++) { m1 = [self getUnitAtX:unit_x + i Y:unit_y - 1]; if (m1 == nil || ![m1 isMemberOfClass:[LPJewelUnit class]] || [m1 rows] > 1 || [m1 unitColor]!=color) { break; } [ar addObject:m1]; } if ([ar count] == unit_columns) { id en2, unit2; merge = YES; en2 = [ar objectEnumerator]; while ((unit2 = [en2 nextObject])) { [_units removeObject:unit2]; } [unit addRows:1]; [unit moveInDir:LP_MOVE_DOWN]; break; } } } } while(merge); } - (void) blowIt { id en; LPUnit *unit; int i; LPUnit *all = nil; if (_gameOver) { return; } en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit isMemberOfClass:[LPSparkerUnit class]]) { if ([unit unitColor] == LP_COLOR_ALL) { [unit blow]; all = [self getUnitAtX:[unit X] Y:[unit Y] - 1]; } else [(LPSparkerUnit *)unit spark]; } } if (all) { en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit unitColor] == [all unitColor]) { [unit softBlow]; } } } i = 0; en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit isBlowing]) { [_blowing addObject:unit]; i++; } } if (i) { // NSLog(@"blow blocks %d",i); } stone -= (i/4) * chain + chain>1?chain:0; en = [_blowing objectEnumerator]; while ((unit = [en nextObject])) { if ([_units containsObject:unit]) { if ([unit rows] > 1) { stone -= [unit rows] * 2 * [unit columns] * (chain + 1); } [_units removeObject:unit]; } } if (i) { chain ++; if (chain >= 2) { stone -= chain; } chaintrip = chain * 2; if (chaintrip > 8) { chaintrip = 8; } if (chain > maxchain) { maxchain = chain; } } else { chain = 0; if (stone < 0) { [__owner player:self addStoneToOp:-stone]; stone = 0; } } #if 0 if (stone < 0) { // NSLog(@"%@ sends %d stones",self,-stone); [__owner player:self addStoneToOp:-stone]; stone = 0; } #endif } - (void) restart { id en; LPUnit * unit; [self gameOver]; if (__currentUnit) { [_units removeObject:__currentUnit]; __currentUnit = nil; } en = [_units objectEnumerator]; while ((unit = [en nextObject])) { [unit blow]; } en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if ([unit isBlowing]) { [_blowing addObject:unit]; } } en = [_blowing objectEnumerator]; while ((unit = [en nextObject])) { [_units removeObject:unit]; } _gameOver = NO; stone = 0; trip = 0; chaintrip = 0; } - (void) refresh { id en; LPUnit *unit; NSMutableArray *ar; ar = [NSMutableArray array]; if (trip) { trip--; } if (chaintrip) { chaintrip--; if (chaintrip == 0) { maxchain = 0; } } en = [_units objectEnumerator]; while ((unit = [en nextObject])) { if (!_gameOver) { [unit changePhase]; } } if (_gameOver) { int cc,xx,yy; LPUnit* unit; cc=0; for (yy = 13; yy >= 0 && cc < 8; yy--) for (xx = 5; xx >= 0; xx--) { unit = [self getUnitAtX:xx Y:yy]; if (unit && [unit unitColor] != LP_COLOR_ALL) { [unit setUnitColor:LP_COLOR_ALL]; cc++; } } } else { en = [_blowing objectEnumerator]; while ((unit = [en nextObject])) { [unit setAlpha:[unit alpha]-0.2]; if ([unit alpha] < 0.2) { [ar addObject:unit]; } } en = [ar objectEnumerator]; while ((unit = [en nextObject])) { [_blowing removeObject:unit]; } } [self setNeedsDisplay:YES]; } - (void) addStone:(int)num { stone += num; if (stone > 0) { trip = 8; } } - (void) addUnit:(id)newUnit { [_units addObject:newUnit]; __currentUnit = newUnit; if (![__currentUnit canMoveInDir:LP_MOVE_DOWN]) { [_units removeObject:__currentUnit]; __currentUnit = nil; [self gameOver]; [__owner lapisPuzzleView:self didFinishUnitWithResult:LP_RESULT_GAMEOVER]; } [self setNeedsDisplay:YES]; } - (void) addJewelUnit { /* id newUnit = [LPGroupUnit alloc]; [newUnit initWithOwner:self atoms:[NSArray arrayWithObjects: _random_unit(newUnit,3,14), _random_unit(newUnit,3,13),nil]]; [self addUnit:AUTORELEASE(newUnit)]; */ } - (void) drawRect:(NSRect)r { int i; id en; LPUnit *unit; /* [_background compositeToPoint:NSZeroPoint operation:NSCompositeCopy]; */ PSsetrgbcolor(0,0,0); PSsetalpha(1.0); // 0.7 PSrectfill(0,0,NSWidth(_bounds),NSHeight(_bounds)); PSsetrgbcolor(1,1,1); PSsetalpha(0.1); PSmoveto(0,0); for (i = 0; i < _numberOfRows; i++) { PSrlineto(NSWidth(_bounds), 0); PSrmoveto(-NSWidth(_bounds), _stepHeight); } PSstroke(); PSmoveto(0,0); for (i = 0; i < _numberOfColumns; i++) { PSrlineto(0,NSHeight(_bounds)); PSrmoveto(_stepWidth,-NSHeight(_bounds)); } PSstroke(); en = [_blowing objectEnumerator]; while ((unit = [en nextObject])) { float p = [(LPJewelUnit *)unit phase] * 50; p = p - 12; PSgsave(); PStranslate((1 - [unit alpha]) * p, (1 - [unit alpha]) * -p); [unit draw]; PSgrestore(); } { int cc,xx,yy; LPUnit* unit; NSMutableSet *set = [NSMutableSet setWithCapacity:70]; cc=0; for (yy = 13; yy >= 0 && cc < 8; yy--) for (xx = 5; xx >= 0; xx--) { unit = [self getUnitAtX:xx Y:yy]; if (unit != nil) { [set addObject:unit]; } } [set makeObjectsPerform:@selector(draw)]; } PSgsave(); PSinitclip(); PSsetrgbcolor(0,0,0); PSsetalpha(0.3); PSrectfill(0, _stepHeight * 12, _stepWidth * 3, _stepHeight); PSrectfill(_stepWidth * 4, _stepHeight * 12, _stepWidth * 2, _stepHeight); PSsetalpha(0.5); PSsetrgbcolor(0.7,0.7,0.7); PSsetlinewidth(4); PSrectstroke(0, _stepHeight * 12, _stepWidth * 3, _stepHeight); PSrectstroke(_stepWidth * 4, _stepHeight * 12, _stepWidth * 2, _stepHeight); PSmoveto(0,NSHeight(_bounds)); PSlineto(0,0); PSlineto(NSWidth(_bounds),0); PSlineto(NSWidth(_bounds),NSHeight(_bounds)); PSstroke(); /****/ PSsetalpha(1); PSsetrgbcolor(0,0,0); PSsetlinewidth(2); PSrectstroke(0, _stepHeight * 12, _stepWidth * 3, _stepHeight); PSrectstroke(_stepWidth * 4, _stepHeight * 12, _stepWidth * 2, _stepHeight); PSmoveto(0,NSHeight(_bounds)); PSlineto(0,0); PSlineto(NSWidth(_bounds),0); PSlineto(NSWidth(_bounds),NSHeight(_bounds)); PSstroke(); PStranslate(-1,1); PSsetrgbcolor(0.8,0.8,0.8); PSsetlinewidth(2); PSrectstroke(0, _stepHeight * 12, _stepWidth * 3, _stepHeight); PSrectstroke(_stepWidth * 4, _stepHeight * 12, _stepWidth * 2, _stepHeight); PSmoveto(0,NSHeight(_bounds)); PSlineto(0,0); PSlineto(NSWidth(_bounds),0); PSlineto(NSWidth(_bounds),NSHeight(_bounds)); PSstroke(); PSgrestore(); if (trip || stone > 0) { int istone = stone > 0?stone:0; NSMutableAttributedString *str; NSString *s; NSSize strSize; NSSize gz = [self gridSize]; s = [NSString stringWithFormat:@"%d",istone]; str = [[NSMutableAttributedString alloc] initWithString:s]; [str addAttribute:NSForegroundColorAttributeName value:[NSColor redColor] range:NSMakeRange(0,[s length])]; [str addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:gz.height*1.2] range:NSMakeRange(0,[s length])]; strSize = [str size]; [str drawAtPoint:NSMakePoint(5 * gz.width - strSize.width/2, 12 * gz.height + gz.height/2 - strSize.height/2)]; RELEASE(str); } if (chaintrip%2 == 1 && maxchain > 1) { NSMutableAttributedString *str; NSString *s; NSSize strSize; NSSize gz = [self gridSize]; s = [NSString stringWithFormat:@"%d CHAINS!",maxchain]; str = [[NSMutableAttributedString alloc] initWithString:s]; [str addAttribute:NSForegroundColorAttributeName value:[NSColor yellowColor] range:NSMakeRange(0,[s length])]; [str addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:gz.height * (maxchain>4?4:maxchain)/4] range:NSMakeRange(0,[s length])]; strSize = [str size]; [str drawAtPoint:NSMakePoint((6 * gz.width / 2) - strSize.width/2, (13 * gz.height / 2) - strSize.height/2)]; RELEASE(str); } } - (NSArray *) allUnits { return _units; } /*** key ***/ - (BOOL) acceptsFirstResponder { return YES; } -(BOOL) performKeyEquivalent: (NSEvent *)event { return NO; } - (id) currentUnit { return __currentUnit; } -(BOOL) processDir:(LPDirType)dir { if (_lockControl) { return NO; } if (__currentUnit == nil) { return NO; } switch(dir) { case LP_MOVE_DOWN: return [__currentUnit moveInDir:LP_MOVE_DOWN]; break; case LP_MOVE_LEFT: return [__currentUnit moveInDir:LP_MOVE_LEFT]; break; case LP_MOVE_RIGHT: return [__currentUnit moveInDir:LP_MOVE_RIGHT]; break; case LP_MOVE_FALL: _lockControl = YES; [__currentUnit fallToBottom]; break; case LP_MOVE_CW: [__currentUnit rotateCW]; break; case LP_MOVE_CCW: [__currentUnit rotateCCW]; break; default: NSAssert(0, @"Unreachable"); break; } [self setNeedsDisplay:YES]; return YES; } -(void) keyDown: (NSEvent *)event { //NSLog(@"%d %@",[event keyCode], [event characters]); switch ([[event characters] characterAtIndex:0]) { case 'a': _useAI = !_useAI; break; case ',': [self processDir:LP_MOVE_CW]; break; case '.': [self processDir:LP_MOVE_CCW]; break; case ' ': [self processDir:LP_MOVE_FALL]; break; case NSUpArrowFunctionKey: [self processDir:LP_MOVE_CCW]; break; case NSLeftArrowFunctionKey: [self processDir:LP_MOVE_LEFT]; break; case NSRightArrowFunctionKey: [self processDir:LP_MOVE_RIGHT]; break; case NSDownArrowFunctionKey: [self processDir:LP_MOVE_DOWN]; break; case 'd': [__owner op:self processDir:LP_MOVE_CW]; break; case 'f': [__owner op:self processDir:LP_MOVE_CCW]; break; case 'x': [__owner op:self processDir:LP_MOVE_LEFT]; break; case 'v': [__owner op:self processDir:LP_MOVE_RIGHT]; break; case 'c': [__owner op:self processDir:LP_MOVE_DOWN]; break; default: break; } [self setNeedsDisplay:YES]; } - (void) toggleAI { _useAI = !_useAI; } - (BOOL) useAI { return _useAI; } @end @implementation LapisNextView - (void) awakeFromNib { chain = 0; trip = 0; chaintrip = 0; _gameOver = NO; _numberOfRows = 2; _numberOfColumns = 1; _stepsInUnit = 1; _stepHeight = NSHeight(_frame)/((float)_numberOfRows); _stepWidth = NSWidth(_frame)/_numberOfColumns; _units = [[NSMutableArray alloc] init]; _blowing = [[NSMutableSet alloc] init]; } - (NSSize) gridSize { return NSMakeSize( NSWidth(_bounds)/(_numberOfColumns * _stepsInUnit), NSHeight(_bounds)/(((float)_numberOfRows) * _stepsInUnit) ); } - (void) addJewelUnit { id newUnit = [LPGroupUnit alloc]; newUnit = [newUnit initWithOwner:self atoms:[NSArray arrayWithObjects: _random_unit(newUnit,0,10,YES), _random_unit(newUnit,0,9,NO),nil]]; [self addUnit:AUTORELEASE(newUnit)]; } - (void) removeUnit:(id)unit { [_units removeObject:unit]; } -(void) keyDown: (NSEvent *)event { } @end LapisPuzzle-1.2/README010064400017500000144000000004751077636434400140040ustar multixusersclick to select view first. 'a' will toggle AI mode. 'x' 'c' 'v' and arrows keys for moving I know this is ugly. A proper preference panel will be added later, I just need to release it today. BUILD NOTES: On Windows, do add -liberty to ADDITIONAL_GUI_LIBS so that random and srandom implementations get linked. LapisPuzzle-1.2/LapisPuzzle.gorm004075500017500000144000000000001152374007600162565ustar multixusersLapisPuzzle-1.2/LapisPuzzle.gorm/data.classes010064400017500000144000000072001010614615000206060ustar multixusers{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "open:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontHelpPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:", "restart:" ); Super = NSObject; }; LPController = { Actions = ( "restart:" ); Outlets = ( lpview1, lpview2, next1, next2, attackList ); Super = NSObject; }; LapisNextView = { Actions = ( ); Outlets = ( ); Super = LapisPuzzleView; }; LapisPuzzleView = { Actions = ( ); Outlets = ( __owner ); Super = NSView; }; }LapisPuzzle-1.2/LapisPuzzle.gorm/objects.gorm010064400017500000144000000146401010614615000206430ustar multixusersGNUstep archive00002a96:00000024:000000c2:00000005:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&!01NSString& %  MenuItem701 NSMenuItem0& % Info Panel...0&&&%01NSImage01NSMutableString&% common_2DCheckMark0 0 & %  common_2DDash%0 & % GormNSMenu0 1 NSMenu0 &%Info01 NSMutableArray1 NSArray&00&%Preferences...0&&&% %00&%Help...0&%?&&% %0& %  MenuItem80&%GormCustomView01 GSCustomView1 GSNibItem0&%LapisPuzzleView A A  Cf C&0& %  MenuItem1000&%New Game0&&&% %0& % GormNSBrowser01 NSBrowser1 NSControl1NSView1 NSResponder% Cu A  C C>  C C>&0 &0 1 NSScrollView% @ @ C C:  C C:&0! &0"1 NSClipView% A  B C:  B C:&0# &0$1NSMatrix%  B B  B B&0% &%0&1 NSActionCell1NSCell0'&0(1NSFont%&&&&&&&&%% B B 0)1NSColor0*&%NSNamedColorSpace0+&%System0,&%controlBackgroundColor)0-& % NSBrowserCell0.1 NSBrowserCell0/&(&&&&&&&&%%00 &2doClick:2doDoubleClick:01*02&%System03&%controlBackgroundColor041 NSScroller%  A C:  A C:&05 &%06/(&&&&&&&&& 2 _doScroll:v12@0:4@8"% A A A A 4%07/(&&&&&&&&.08&%NSMatrix09&%/% B0:% @ ? B A  B A&0; &%0</(&&&&&&&&&2 scrollViaScroller:v12@0:4@8   C C:0= &0>1NSBrowserColumn $%9%%0?& %  MenuItem90@& %  MenuItem110A& % My Window0B1NSWindow%  D D& % C Dk@0C%  D D  D D&0D &0E 0F&%LapisPuzzleView C A  Cf C&0G 0H& % LapisNextView Cu C BH B&0I 0J& % LapisNextView C C BH B&0K1 NSTextField% Cu C B A  B A&0L &%0M1NSTextFieldCell0N&%Next0O% A`&&&&&&&&%0P*0Q&%System0R&%textBackgroundColor0S*Q0T& % textColor0U% C C B A  B A&0V &%0W0X&%NextO&&&&&&&&%0Y*0Z&%System0[&%textBackgroundColor0\*Z0]& % textColor0^*0_&%System0`&%windowBackgroundColor0a&%Window0b& % LapisPuzzleb ? B F@ F@%0c0d&%NSApplicationIcon0e& %  MenuItem120f& %  MenuItem130g& %  GormNSMenu1 0h& %  MenuItem140i& %  MenuItem150j 0k&&&% 2submenuAction:% 0l 0m& % LapisPuzzle0n &j0o0p&%Hide0q&%h&&% %0r0s&%Quit0t&%q&&% %0u& %  MenuItem16o0v& %  MenuItem17r0w& % TextFieldK0x&%GSCustomClassMap0y&0z& % LPController0{ z  &0|&% GormCustomView1E0}&% GormCustomView2G0~&% GormCustomView3I0& % NSVisible0 &B0&%NSMenul0& %  TextField1U0&%NSOwner0& % NSApplication0& %  MenuItem1r0&%MenuItemo0& %  MenuItem2o0& %  MenuItem3r0& %  MenuItem4o0& %  MenuItem5r0& %  MenuItem6j0 &!!01NSNibConnectorA0&%NSOwner0001 NSNibControlConnector0&%NSFirst0&%hide:00 0& % terminate:00|0z01!NSNibOutletConnectorz0&%lpview10!z|0&%lpview20!z0&% delegate0!z0&%__owner0!|z0&% __owner0}0~0!z}0&%next10!z~0&%next200 0&%submenuAction:0g0eg0 e0&%orderFrontStandardInfoPanel:0fg0hg0 h0&%orderFrontHelpPanel:0@0 @z0&% restart:0w000!z0&% delegate0!z0& %  attackList01" GSMutableSet1# NSMutableSet1$NSSet&l{BLapisPuzzle-1.2/version.plist010064400017500000144000000007121156155270300156470ustar multixusers BuildVersion 92 CFBundleVersion 1.0 ProductBuildVersion 7K571 ProjectName NibPBTemplates SourceVersion 1200000 LapisPuzzle-1.2/ChangeLog010064400017500000144000000010041157252510300146460ustar multixusers2011-06-04 Riccardo Mottola * LPController.m * LapisPuzzleView.h * LapisPuzzleView.m Warning fixes and cleanup. 2011-06-01 Riccardo Mottola * LapisPuzzleView.m: Warning fix and and memory leak. 2011-06-01 Riccardo Mottola * LapisPuzzleView.m: Warning fix and cleanup. 2011-05-05 Riccardo Mottola * main.m: * LapisPuzzleView.m: Trivial warning fix. 2011-05-05 Riccardo Mottola * main.m: Cleanup and make work with latest gnustep. LapisPuzzle-1.2/Info.plist010064400017500000144000000014121161001422600150370ustar multixusers CFBundleDevelopmentRegion English CFBundleExecutable LapisPuzzle CFBundleIconFile CFBundleIdentifier org.gap.LapisPuzzle CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleSignature ???? CFBundleVersion 1.2 NSMainNibFile LapisPuzzle NSPrincipalClass NSApplication LapisPuzzle-1.2/LapisPuzzle.xcode004075500017500000144000000000001156727341500164225ustar multixusersLapisPuzzle-1.2/LapisPuzzle.xcode/project.pbxproj010064400017500000144000000211311156155270300215420ustar multixusers// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 39; objects = { 080E96DDFE201D6D7F000001 = { children = ( 85C45C5E137682A7004F6E40, 85C45C5F137682A7004F6E40, 85C45C60137682A7004F6E40, 85C45C61137682A7004F6E40, ); isa = PBXGroup; name = Classes; refType = 4; sourceTree = ""; }; 089C165CFE840E0CC02AAC07 = { children = ( 089C165DFE840E0CC02AAC07, ); isa = PBXVariantGroup; name = InfoPlist.strings; refType = 4; sourceTree = ""; }; 089C165DFE840E0CC02AAC07 = { fileEncoding = 10; isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; refType = 4; sourceTree = ""; }; //080 //081 //082 //083 //084 //100 //101 //102 //103 //104 1058C7A0FEA54F0111CA2CBB = { children = ( 1058C7A1FEA54F0111CA2CBB, ); isa = PBXGroup; name = "Linked Frameworks"; refType = 4; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; refType = 0; sourceTree = ""; }; 1058C7A2FEA54F0111CA2CBB = { children = ( 29B97325FDCFA39411CA2CEA, 29B97324FDCFA39411CA2CEA, ); isa = PBXGroup; name = "Other Frameworks"; refType = 4; sourceTree = ""; }; //100 //101 //102 //103 //104 //190 //191 //192 //193 //194 19C28FACFE9D520D11CA2CBB = { children = ( 8D1107320486CEB800E47090, ); isa = PBXGroup; name = Products; refType = 4; sourceTree = ""; }; //190 //191 //192 //193 //194 //290 //291 //292 //293 //294 29B97313FDCFA39411CA2CEA = { buildSettings = { }; buildStyles = ( 4A9504CCFFE6A4B311CA0CBA, 4A9504CDFFE6A4B311CA0CBA, ); hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 29B97314FDCFA39411CA2CEA; projectDirPath = ""; targets = ( 8D1107260486CEB800E47090, ); }; 29B97314FDCFA39411CA2CEA = { children = ( 080E96DDFE201D6D7F000001, 29B97315FDCFA39411CA2CEA, 29B97317FDCFA39411CA2CEA, 29B97323FDCFA39411CA2CEA, 19C28FACFE9D520D11CA2CBB, ); isa = PBXGroup; name = LapisPuzzle; path = ""; refType = 4; sourceTree = ""; }; 29B97315FDCFA39411CA2CEA = { children = ( 85C45C5D137682A7004F6E40, 29B97316FDCFA39411CA2CEA, ); isa = PBXGroup; name = "Other Sources"; path = ""; refType = 4; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA = { fileEncoding = 4; isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; refType = 4; sourceTree = ""; }; 29B97317FDCFA39411CA2CEA = { children = ( 8D1107310486CEB800E47090, 089C165CFE840E0CC02AAC07, 29B97318FDCFA39411CA2CEA, ); isa = PBXGroup; name = Resources; path = ""; refType = 4; sourceTree = ""; }; 29B97318FDCFA39411CA2CEA = { children = ( 29B97319FDCFA39411CA2CEA, ); isa = PBXVariantGroup; name = LapisPuzzle.nib; path = ""; refType = 4; sourceTree = ""; }; 29B97319FDCFA39411CA2CEA = { isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/LapisPuzzle.nib; refType = 4; sourceTree = ""; }; 29B97323FDCFA39411CA2CEA = { children = ( 1058C7A0FEA54F0111CA2CBB, 1058C7A2FEA54F0111CA2CBB, ); isa = PBXGroup; name = Frameworks; path = ""; refType = 4; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; refType = 0; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; refType = 0; sourceTree = ""; }; //290 //291 //292 //293 //294 //4A0 //4A1 //4A2 //4A3 //4A4 4A9504CCFFE6A4B311CA0CBA = { buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; ZERO_LINK = YES; }; isa = PBXBuildStyle; name = Development; }; 4A9504CDFFE6A4B311CA0CBA = { buildSettings = { COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; ZERO_LINK = NO; }; isa = PBXBuildStyle; name = Deployment; }; //4A0 //4A1 //4A2 //4A3 //4A4 //850 //851 //852 //853 //854 85C45C5D137682A7004F6E40 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LapisPuzzle.h; refType = 4; sourceTree = ""; }; 85C45C5E137682A7004F6E40 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LapisPuzzleView.h; refType = 4; sourceTree = ""; }; 85C45C5F137682A7004F6E40 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LapisPuzzleView.m; refType = 4; sourceTree = ""; }; 85C45C60137682A7004F6E40 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LPController.h; refType = 4; sourceTree = ""; }; 85C45C61137682A7004F6E40 = { fileEncoding = 30; isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LPController.m; refType = 4; sourceTree = ""; }; 85C45C62137682A7004F6E40 = { fileRef = 85C45C5D137682A7004F6E40; isa = PBXBuildFile; settings = { }; }; 85C45C63137682A7004F6E40 = { fileRef = 85C45C5E137682A7004F6E40; isa = PBXBuildFile; settings = { }; }; 85C45C64137682A7004F6E40 = { fileRef = 85C45C5F137682A7004F6E40; isa = PBXBuildFile; settings = { }; }; 85C45C65137682A7004F6E40 = { fileRef = 85C45C60137682A7004F6E40; isa = PBXBuildFile; settings = { }; }; 85C45C66137682A7004F6E40 = { fileRef = 85C45C61137682A7004F6E40; isa = PBXBuildFile; settings = { }; }; //850 //851 //852 //853 //854 //8D0 //8D1 //8D2 //8D3 //8D4 8D1107260486CEB800E47090 = { buildPhases = ( 8D1107290486CEB800E47090, 8D11072C0486CEB800E47090, 8D11072E0486CEB800E47090, ); buildRules = ( ); buildSettings = { GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G3; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREFIX_HEADER = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; PRODUCT_NAME = LapisPuzzle; WRAPPER_EXTENSION = app; }; dependencies = ( ); isa = PBXNativeTarget; name = LapisPuzzle; productInstallPath = "$(HOME)/Applications"; productName = LapisPuzzle; productReference = 8D1107320486CEB800E47090; productType = "com.apple.product-type.application"; }; 8D1107290486CEB800E47090 = { buildActionMask = 2147483647; files = ( 8D11072A0486CEB800E47090, 8D11072B0486CEB800E47090, 85C45C62137682A7004F6E40, 85C45C63137682A7004F6E40, 85C45C65137682A7004F6E40, ); isa = PBXResourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8D11072A0486CEB800E47090 = { fileRef = 29B97318FDCFA39411CA2CEA; isa = PBXBuildFile; settings = { }; }; 8D11072B0486CEB800E47090 = { fileRef = 089C165CFE840E0CC02AAC07; isa = PBXBuildFile; settings = { }; }; 8D11072C0486CEB800E47090 = { buildActionMask = 2147483647; files = ( 8D11072D0486CEB800E47090, 85C45C64137682A7004F6E40, 85C45C66137682A7004F6E40, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8D11072D0486CEB800E47090 = { fileRef = 29B97316FDCFA39411CA2CEA; isa = PBXBuildFile; settings = { ATTRIBUTES = ( ); }; }; 8D11072E0486CEB800E47090 = { buildActionMask = 2147483647; files = ( 8D11072F0486CEB800E47090, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; }; 8D11072F0486CEB800E47090 = { fileRef = 1058C7A1FEA54F0111CA2CBB; isa = PBXBuildFile; settings = { }; }; 8D1107310486CEB800E47090 = { fileEncoding = 4; isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; refType = 4; sourceTree = ""; }; 8D1107320486CEB800E47090 = { explicitFileType = wrapper.application; includeInIndex = 0; isa = PBXFileReference; path = LapisPuzzle.app; refType = 3; sourceTree = BUILT_PRODUCTS_DIR; }; }; rootObject = 29B97313FDCFA39411CA2CEA; }