Skip to content

Commit

Permalink
Merge pull request #1881 from uqbar-project/dev
Browse files Browse the repository at this point in the history
Releasing v1.9.2
  • Loading branch information
fdodino authored Dec 2, 2019
2 parents 0bb3de3 + 3fe629e commit eb1f5f1
Show file tree
Hide file tree
Showing 267 changed files with 1,720 additions and 15,836 deletions.
23 changes: 17 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
*/bin/
/eclipse/*
**/target/
.metadata/*
.DS_Store
/target/
*/workspace/
org.eclipse.*
pom.xml.versionsBackup
*._trace
CHANGELOG.txt
changelog.txt
CHANGELOG.md

# Xtend generated files
/target/
xtend-gen
*/bin/
**/target/

# Eclipse files
.metadata/*
/eclipse/*
eclipse
.classpath
.project
.recommenders

# VSC - Git Lens
.history

# Release scripts
scripts/libs
scripts/jars
scripts/wollok-site
scripts/wollok-cli
scripts/wollok-cli

# Ignoring wollok-language files
org.uqbar.project.wollok.lib/src/wollok/*.wlk
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "wollok-language"]
path = wollok-language
url = https://github.com/uqbar-project/wollok-language.git
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ after_success:
cd ..
fi
script:
- "./wollokInstall.sh"
- cd org.uqbar.project.wollok.releng/
- export PROFILES=normalProfile
- export UPDATE_SITE=none
Expand Down Expand Up @@ -126,6 +127,16 @@ deploy:
on:
all_branches: true
condition: "$UPDATE_SITE =~ ^dev|stable$"
- provider: releases
skip_cleanup: true
api_key:
secure: ZGDMxFYXbp/LgNqtGourJXgQS2itBxHWzLqDKnSd1YV6sDHnYzvrq8aCoLHujMCI0yLkRAI12raylJkXHzQHcN3JDF0SyJostz59x1KEJ4cpv8K5bb2bs8BsV/BuZlQssu6yqqgaIXOALF52wUGgVg8nBjWA0LdRL5DDFs8ExR0=
file_glob: true
file: results-products/*.zip
on:
tags: true
all_branches: true
repo: uqbar-project/wollok
env:
global:
secure: IJCZW9xrLlUjs/HRkrpagk06zo2+FvKaMygUk6K9Fdim3uSsLmn4UyBazNli0a62oq3XuNpscsCmdVtofUCfZphEHnyIUUTToQ+u6j1KxbICjfIGFMmUEoY/7tZVscQ5SBgiqtEVfUvolN6v4YUtx2FwaS27FW5SV3/x8j6toPw=
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

A programming language and environment for teaching OOP.

## Xtext-based implementation notes

This is the main repository for the Wollok Xtext-based implementation, which is part of the [Wollok Language Specification](https://github.com/uqbar-project/wollok-language)

## Installation ##

You have two options to download an use Wollok.
Expand All @@ -22,13 +26,11 @@ You have two options to download an use Wollok.
* http://update.uqbar.org/wollok/stable : for the latest stable release
* http://update.uqbar.org/wollok/dev : for the current dev (work in progress) version

Or drag and drop <a href="http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=2420552" class="drag" title="Drag to your running Eclipse workspace to install Wollok"><img src="https://marketplace.eclipse.org/sites/all/themes/solstice/_themes/solstice_marketplace/public/images/btn-install.png" alt="Drag to your running Eclipse workspace to install Wollok" /></a>

## Wollok SDK standalone ##

Finally if you just want the headless Development Kit (WDK), for example to use a different IDE than Eclipse, you can download it from

* http://download.uqbar.org/wollok/sdk/
- https://github.com/uqbar-project/wollok-cli

This is useful for example if you are going to develop with [Sublime](https://github.com/uqbar-project/wollok-sublime-linter/blob/master/README.md) or any other lightweight text editor

Expand All @@ -45,7 +47,7 @@ Refer to the [wiki](https://github.com/uqbar-project/wollok/wiki/Home) for docum
* A **clean modern syntax** avoiding unnecessary symbols (java) while keeping it simple and even familiar for those who already have some experience in programming)
* **Interpreted**: means that the code is being evaluated as it's being read. Although its **declarative syntax** makes it feel like a compiled language

```xtend
```wollok
package fliers {
object superman {
Expand All @@ -71,7 +73,7 @@ package fliers {
[ superman, new Plane(), aBird ].forEach { o => o.fly() }
```

Check out our [Language Reference](https://github.com/uqbar-project/wollok/wiki/LanguageReference) for a concrete idea of the syntax
Check out our [Language Reference](https://www.wollok.org/en/documentation/concepts/) for a concrete idea of the syntax

## How is the Environment ? ##

Expand All @@ -80,10 +82,8 @@ You can either use its IDE:
* With: many **static code analysis**, **Quick-Fixes**, **Refactors**
* An **interactive Console** (**REPL**)
* **Visual representations**: Outline, Static diagram, Objects Diagrams
* A **debugger**.

Or use the WDK which has command line tools for running and checkin a program.
This is also integrated with [Sublime Editor](https://github.com/uqbar-project/wollok-sublime-linter/blob/master/README.md).
Or use the wollok-cli which has command line tools for running and checkin a program.

## How to Contribute ##

Expand Down Expand Up @@ -123,14 +123,11 @@ Distributed under the terms of LGPLv3
* [Estefanía Miguel](https://github.com/orgs/uqbar-project/people/estefaniamiguel)

## Metrics ##
[![Throughput Graph](https://graphs.waffle.io/uqbar-project/wollok/throughput.svg)](https://waffle.io/uqbar-project/wollok/metrics)

[![PRs](https://img.shields.io/github/issues-pr/uqbar-project/wollok.svg?maxAge=2592000)]()
[![closed PRs](https://img.shields.io/github/issues-pr-closed/uqbar-project/wollok.svg?maxAge=2592000)]()

[![issues](https://img.shields.io/github/issues-raw/badges/uqbar-project/wollok.svg?maxAge=2592000)]()
[![issue resolution](http://isitmaintained.com/badge/resolution/uqbar-project/wollok.svg)](http://isitmaintained.com/project/uqbar-project/wollok "Average time to resolve an issue")

[![Stories in Ready](https://badge.waffle.io/uqbar-project/wollok.png?label=ready&title=Ready)](https://waffle.io/uqbar-project/wollok)

[![open issues](http://isitmaintained.com/badge/open/uqbar-project/wollok.svg)](http://isitmaintained.com/project/uqbar-project/wollok "Percentage of issues still open")
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
version: '{build}'
os: Windows Server 2012
install:
- cd %APPVEYOR_BUILD_FOLDER%
- wollokInstall.bat
- ps: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven" )) {
Expand Down
2 changes: 1 addition & 1 deletion org.uqbar.project.wollok.game/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Wollok Game
Bundle-SymbolicName: org.uqbar.project.wollok.game
Bundle-Version: 1.9.0
Bundle-Version: 1.9.2
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.junit;version="4.11.0",
org.osgi.framework;version="1.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ public class Messages extends NLS {

public static String WollokGame_NoMessage;
public static String WollokGame_ObjectAlreadyInGame;

public static String WollokGame_SoundGameNotStarted;
public static String WollokGame_SoundAlreadyPlayed;
public static String WollokGame_PausedOrResumedANotPlayedSound;
public static String WollokGame_SoundAlreadyPaused;
public static String WollokGame_VolumeOutOfRange;
public static String WollokGame_SoundAlreadyPlaying;
public static String WollokGame_SoundNotYetPlayed;

public static String WollokGame_CharacterKeyNotFound;
public static String WollokGame_ListenerNotFound;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ abstract class Position {
def abstract int getX()
def abstract int getY()

def getXinPixels() { x * Gameboard.CELLZISE }
def int getXinPixels() { x * Gameboard.instance.cellsize }

def getYinPixels() { y * Gameboard.CELLZISE }
def int getYinPixels() { y * Gameboard.instance.cellsize }

override public int hashCode() {
val prime = 31
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class VisualComponent {
val yMouse = Gdx.input.y
val bottomX = position.xinPixels
val bottomY = Gameboard.getInstance().pixelHeight - position.yinPixels
val topX = bottomX + Gameboard.CELLZISE
val topY = bottomY - Gameboard.CELLZISE
val topX = bottomX + Gameboard.instance.cellsize
val topY = bottomY - Gameboard.instance.cellsize
return (xMouse > bottomX && xMouse < topX) && (yMouse < bottomY && yMouse > topY)
}

Expand Down Expand Up @@ -147,30 +147,4 @@ class VisualComponent {
if (position.x < Gameboard.instance.width - 1)
setPosition(getPosition.right())
}
}

@Accessors
class WGVisualComponent extends VisualComponent {
Position _position
Image image
List<String> attributes

new(Position position, Image image) {
super(null)
this._position = position
this.image = image
}

override Image getImage() {
image
}

override Position getPosition() {
_position
}

override setPosition(Position position) {
_position = position
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Cell {

new(Position position, Image image) {
this.position = position
this.image = image => [ size = new CellSize(Gameboard.CELLZISE) ]
this.image = image => [ size = new CellSize(Gameboard.instance.cellsize) ]
}

def draw(Window window) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package org.uqbar.project.wollok.game.gameboard

import com.badlogic.gdx.Gdx
import com.badlogic.gdx.audio.Sound
import org.eclipse.osgi.util.NLS
import org.eclipse.xtend.lib.annotations.Accessors
import org.uqbar.project.wollok.game.Messages

@Accessors
class GameSound {
String file
Long soundID
Sound sound
Boolean looped = false
Float volume = 1.0f
Boolean paused = false

def play() {
if (played)
throw new RuntimeException(Messages.WollokGame_SoundAlreadyPlayed)
if (!looped)
soundID = fetchSound.play(volume)
else
soundID = fetchSound.loop(volume)
}

def played() {
soundID !== null
}

def stop() {
if(!played)
throw new RuntimeException(Messages.WollokGame_SoundNotYetPlayed)
fetchSound.stop()
fetchSound.dispose()
}

def pause() {
if (!played)
throw new RuntimeException(Messages.WollokGame_PausedOrResumedANotPlayedSound)
if (paused)
throw new RuntimeException(Messages.WollokGame_SoundAlreadyPaused)
fetchSound.pause()
paused = true
}

def resume() {
if (!played)
throw new RuntimeException(Messages.WollokGame_PausedOrResumedANotPlayedSound)
if (!paused)
throw new RuntimeException(Messages.WollokGame_SoundAlreadyPlaying)
fetchSound.resume()
paused = false
}

def paused() {
paused
}

def volume(Float newVolume) {
if (newVolume < 0 || newVolume > 1)
throw new RuntimeException(Messages.WollokGame_VolumeOutOfRange)
volume = newVolume
syncVolume()
}

def volume() {
volume
}

def syncVolume() {
if (played) {
fetchSound.setVolume(soundID, volume)
}
}

def shouldLoop(Boolean looping) {
looped = looping
syncLoop()
}

def shouldLoop() {
looped
}

def syncLoop() {
if (played) {
fetchSound.setLooping(soundID, looped)
}
}

def fetchSound() {
if (Gdx.app === null)
throw new RuntimeException(Messages.WollokGame_SoundGameNotStarted)

if (sound === null) {
try {
val soundFile = Gdx.files.internal(file)
sound = Gdx.audio.newSound(soundFile)
} catch (Exception e) {
println(NLS.bind(Messages.WollokGame_AudioNotFound, file))
}
}
sound
}

}
Loading

0 comments on commit eb1f5f1

Please sign in to comment.